I'm trying to start development on a Flex Mobile app that my company is developing in Adobe AIR (using Flash Builder). The app will initially be released for iPhone and Android, and eventually BlackBerry PlayBook tablets as well.
However, one of the requirements is that we need to be able to launch the app from the browser on the device, and pass a parameter into it.
I'm not sure what I am doing wrong, but I can't get this to work. I've put the following block of code in the Android section. I'm just working with Android for the moment, for initial testing. Its easy to drop an APK onto an Android device, and I've got one sitting right here.
<application>
<activity android:name=".MyUriActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" android:host="path" />
</intent-filter>
</activity>
</application>
I've also got this code for handling the event:
import mx.events.FlexEvent;
protected function application_preinitializeHandler(event:FlexEvent):void
{
NativeApplication.nativeApplication.addEventListener(
InvokeEvent.INVOKE, onInvoke);
}
private function onInvoke(event:InvokeEvent):void
{
// You can parse argument value from event.arguments property
Text1.text = "Arguments: " + event.arguments;
}
The allowBrowserInvocation flag is set to true.
I tried creating a test HTML page with the following links, but I just get a "Webpage not available" message in the Android browser.
<a href="myapp:">myapp:</a>
<br><br>
<a href="myapp:#Intent;action=android.intent.action.view;end">click to load apk</a>
I've read all of the following posts, but I'm still having trouble. Can someone please help me out? What am I missing?