Passing Data Between two Corona Apk's

 

Hi ,

I want to pass a plain text from one APK to another in corona.
Native Android Developers use Intent to do this…

& It is also possible to declare intent-filter tag in build.settings corona.

Thus even if i registered the Intent Sender & Receiver in both APK , So is it possible to fetch data.

 

 


build.settings:

intentFilters =
{
{
label = “SenderApp”,
actions = {“android.intent.action.VIEW” , "android.intent.action.SEND "},
categories =
{
“android.intent.category.DEFAULT”,
“android.intent.category.BROWSABLE”
},
data = {scheme = “SenderApp”}
},
}


Kindly please guide.

Thanks
Assif

See if these threads can help you:

https://forums.coronalabs.com/topic/37105-handling-url-scheme-on-android/

https://forums.coronalabs.com/topic/40266-app-url-scheme/

https://forums.coronalabs.com/topic/41201-custom-url-schemes-on-chrome-android/

Rob

@Rob Thanks a lot man  :slight_smile:

Found a important post in it by Joshua Quick [Hope it will work] , please have a look on it…


Both the “main.lua” launch arguments and the “applicationOpen” event will have an “androidIntent” Lua table which is only made available on Android.  The “androidIntent” table will have the following fields…

– Provides the URI returned by the Java Intent.getData() method.
androidIntent.url

– Provides the action string returned by the Intent.getAction() method.
androidIntent.action

– A Lua string array matching the collection returned by the Intent.getCategories() method.
androidIntent.categories

– A Lua table matching the Bundle returned by the Intent.getExtras() method.
– The keys are strings and the values are Lua types that best match the Java value types.
– Note that this does support nested tables/bundles.
androidIntent.extras 

 

You’ll need to make sure to do if checks on each of the above fields in the “androidIntent” table before attempting to access its data.  If the Java equivalent Intent methods return null, then they will be set to nil on the Lua side.

 

Information about the Android “Intent” Java class can be found here…

   http://developer.android.com/reference/android/content/Intent.html

 

 

 

  • Assif

Hi all. I’m trying to use intentFilters for simple ‘set’ an app in android to open with certain file extension.

Any guide to do it?

For example, if I have certain file type like ‘my file.xyz’, adjust to open the app (or at least give the chance to do it from email or other app for example) with my app.

Thanks so much in advance,

See if these threads can help you:

https://forums.coronalabs.com/topic/37105-handling-url-scheme-on-android/

https://forums.coronalabs.com/topic/40266-app-url-scheme/

https://forums.coronalabs.com/topic/41201-custom-url-schemes-on-chrome-android/

Rob

@Rob Thanks a lot man  :slight_smile:

Found a important post in it by Joshua Quick [Hope it will work] , please have a look on it…


Both the “main.lua” launch arguments and the “applicationOpen” event will have an “androidIntent” Lua table which is only made available on Android.  The “androidIntent” table will have the following fields…

– Provides the URI returned by the Java Intent.getData() method.
androidIntent.url

– Provides the action string returned by the Intent.getAction() method.
androidIntent.action

– A Lua string array matching the collection returned by the Intent.getCategories() method.
androidIntent.categories

– A Lua table matching the Bundle returned by the Intent.getExtras() method.
– The keys are strings and the values are Lua types that best match the Java value types.
– Note that this does support nested tables/bundles.
androidIntent.extras 

 

You’ll need to make sure to do if checks on each of the above fields in the “androidIntent” table before attempting to access its data.  If the Java equivalent Intent methods return null, then they will be set to nil on the Lua side.

 

Information about the Android “Intent” Java class can be found here…

   http://developer.android.com/reference/android/content/Intent.html

 

 

 

  • Assif

Hi all. I’m trying to use intentFilters for simple ‘set’ an app in android to open with certain file extension.

Any guide to do it?

For example, if I have certain file type like ‘my file.xyz’, adjust to open the app (or at least give the chance to do it from email or other app for example) with my app.

Thanks so much in advance,