Passing parameters from java activity to an Adobe AIR application

How can we pass parameters from Java activity when starting another application like AIR?

As we do for java activity, use Intent extra. What is a parameter passing mechanism when it runs in Java and an AIR application on Android. We are currently passing parameters by sharing a common place (sqlite db) and polling it every second. This is not a good design, and I'm sure there must be a good way to do this. Please enlighten me.

+6
source share
3 answers

In Adobe AIR 2.5, you can pass parameters to an AIR application using custom URIs.

Using this function, the application can be invokable in the browser or in the native Android application. When the application is called from the browser / android, the InvokeEvent application InvokeEvent sent to the application. To make an application invokable from a browser, add it to your application descriptor (as a child of the application):

 <android> <manifestAdditions> <![CDATA[ <manifest> <application> <activity> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="testapp"/> </intent-filter> </activity> </application> </manifest> ]]> </manifestAdditions> </android> 

Now, to launch the application from the browser, specify the url as: testapp:// . Example:

 <a href="testapp://">click here to launch air test app from browser</a> 

By clicking on this link, you will launch the application.

If you want to pass additional arguments to your application from the browser, use something like this:

 <a href="testapp://arg1=value&secondArgument=someValue">click here to launch air test app from browser</a> 

After starting your application, select the argument property of the resulting InvokeEvent . This will contain the full URI ( testapp://arg1=value&secondArgument=someValue ), and you can testapp://arg1=value&secondArgument=someValue it to extract the arguments.

From here .

+9
source

In addition to the answer above, to run the adobe air application from an Android application using Intent, do the following:

 Intent i = Intent.parseUri("testapp://arguments-to-pass",Intent.URI_INTENT_SCHEME); i.addCategory(Intent.CATEGORY_BROWSABLE); i.setComponent(null); i.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); startActivity(i); 
+3
source

swf files are the result of mxml, this is the method described above for transferring values ​​from android to mxml or to .swf. What changes should we make using .swf or .mxml. I am compiling mxml on FB (Flash Builder) 4.5 and calling it from eclipse for Android. Rgds, Saurabh

+1
source

Source: https://habr.com/ru/post/885471/


All Articles