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 .
source share