Skip to main content
Deesnay
Participant
January 31, 2014
Answered

AIR | Android | Open app from another app

  • January 31, 2014
  • 2 replies
  • 1590 views

Hi,

I'm trying to get app A open app B on Android (by clicking some button from app A).

Both apps are developed with FlashBuilder 4.7.

I've tried several solutions without success.

I've tried a specific URI scheme, but it failed.

I also tried the following trick:

– embed a fake file in app A with a fake file extension, e.g. "fakefile.appb".

– register app B as the default app to open that kind of files (via manifest additions)

– in app A, add a button linking to fakefile.appb, so that app B opens.

But I can't even get my fakefile.appb to trigger opening of app B.

Did some of you use one of these methods successfully?

Am I missing something?

Any other idea to achieve that type of behaviour?

Thanks in advance!

D.

This topic has been closed for replies.
Correct answer denisr704218734737017

Finally, it works that way:

AS3 code of the app that needs to open the other app:

navigateToURL(new URLRequest("apptoopen://"));

"apptoopen" is the ID of the other app, as specified in its 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="apptoopen"/>

                              </intent-filter>

                         </activity>

               </application>

          </manifest>

     ]]>

     </manifestAdditions>

</android>

No ANE is required. Maybe it was required at the time when the question was asked.

I'm testing on Android 7.0 (on a Samnsung Galaxy Tab A device).

The apps are compiled with SDK AIR 31.

2 replies

simonk10452897
Participating Frequently
February 3, 2017

Did you manage to find a solution to this?

I am developing an AIR app for Android that needs to launch another app made in Unity.

denisr704218734737017Correct answer
Inspiring
January 8, 2019

Finally, it works that way:

AS3 code of the app that needs to open the other app:

navigateToURL(new URLRequest("apptoopen://"));

"apptoopen" is the ID of the other app, as specified in its 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="apptoopen"/>

                              </intent-filter>

                         </activity>

               </application>

          </manifest>

     ]]>

     </manifestAdditions>

</android>

No ANE is required. Maybe it was required at the time when the question was asked.

I'm testing on Android 7.0 (on a Samnsung Galaxy Tab A device).

The apps are compiled with SDK AIR 31.

Participating Frequently
February 3, 2014

You will need an ANE for it since you need to trigger the activity intent.