Skip to main content
Participant
May 23, 2013
Question

Return parameter from android air app to java app

  • May 23, 2013
  • 1 reply
  • 943 views

I am passing parameter from android java app to air app by using the following,

ANDROID AIR

By using this feature an application can be made invokable from browser or native android application. When the application is invoked from browser/android-app, an InvokeEvent is dispatched to the application. For making an application invokable from browser, add this in your application descriptor (as child of application element):

<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 your application from browser, provide the url as: testapp://. An example is:

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

In JAVA CODE


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);

Now I would like to return some parameters from the ANDROID Air App to JAVA App

Please help me.


This topic has been closed for replies.

1 reply

Known Participant
May 24, 2013

What if you just invoke something like javaapp:// from the Air App and pass the return value as a parameter? Of course, in that case you need to register JAVA App as the handler for javaapp:// scheme. And it will be activated in result.