How to receive data from the send intent?
Asked Answered
A

1

8

How to receive data from the send intent in an Adobe Air based Android app?

I tried it the way below, but the incoming arguments array and event is empty, the shared content is missing.

Here are my Air source files and a test .apk file, it would be great if someone could take a look at it.

AIR:

import flash.desktop.NativeApplication;
import flash.events.InvokeEvent;

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE, onBrowserInvoke);

function onInvoke(event:InvokeEvent):void
{
trace("\n Invoke event: " + event)
}

function onBrowserInvoke(event:BrowserInvokeEvent):void
{
trace("\n Browser Invoke event: " + event)
}

XML (app.xml manifest):

<android> 
    <manifestAdditions> 
      <![CDATA[ 
               <manifest>
<uses-permission android:name="android.permission.INTERNET"/>
   <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="helloworld"/>
                    </intent-filter>
                <intent-filter> 
        <action android:name="android.intent.action.SEND"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <data android:mimeType="text/plain"/>
    </intent-filter>
                        </activity>
            </application>   
        </manifest>
    ]]>
    </manifestAdditions> 
  </android>
Antabuse answered 19/2, 2014 at 20:9 Comment(5)
Here the same question in adobe forum: forums.adobe.com/message/5477286 hope you can find something helpful there, i've tried to open your project but my flash builder 4.6 crash while opening it :sPrevention
Did you solve the problem? I'm getting the same behavior...Crompton
Yes, I solved it with a native extension.Antabuse
Did you built the ANE or used a 3rd party one? If possible, could you share it?Crompton
@Crompton What's your email? I can send you details in private.Antabuse
C
-1

I suggest to return the data you want from the native extension using a struct, see this answer for details.

Cannonball answered 22/2, 2014 at 8:45 Comment(2)
This answer doesn't make any sense... =|Crompton
it is a way of sending data from android (using native extension) to air.Cannonball

© 2022 - 2024 — McMap. All rights reserved.