I am working on an Adobe AIR app that will run on Android devices. The current issue I am facing is that I have received a jar file that contains an Android Activity that launches the camera, recognizes an image, and returns an id code back to the application letting the developer know which image was recognized. Thus, I need to launch the Activity from the AIR app and then return to the AIR app with the id code accessible. Is this possible?
I have read several answers regarding communicating with an AIR app via Android, but I haven't found any for communicating with an Activity via an AIR app.
Thanks so much!
You can start an intent on Android with navigateToURL(), details are described here:
Launching intents
For the data return, your AIR app can register a custom URI scheme which the native app can use to talk back to your app:
Custom URI scheme
Alternatively, you can use (or maybe find it somewhere) an ANE that uses startActivityForResult() native Android API to achieve two-way communication in a single call. AIR doesn't support that by itself, I believe.
Related
I'm creating a web-based dashboard on an Android device, and would like to open an installed Android app (https://play.google.com/store/apps/details?id=com.camera.one.s10.camera in this case) from the browser.
How do I find the scheme and available intents from an existing app?
I understand the link format is
Link
and the scheme in this case is "com.camera.one.s10.camera", but the tutorials I have read (e.g. Launch custom android application from android browser) describe how to do this when creating one's own manifest, not discovering possible actions from an arbitrary app.
Thanks!
I'm making a mobile webpage that needs to have a bunch of links to various installed apps through the MDM. This is for managed devices and will launch both enterprise-internal apps and third-party. It does not need to do anything other than just launch.
I've been looking everywhere on how to make some simple basic links to simply launch the apps and nothing more.
I've tried some of the syntax below but it fails to actually open the installed app and instead just takes you to app store:
Take a QR code
<intent android:action="launch" >
<extra android:name="com.a14integrated.full" android:value="com.a14integrated.full" />
LAUNCH?
</intent>
UPDATE #1:
After more research I'm giving this up as it doesn't seem generically possible but rather something each app maker must implement themselves.
Not generically possible -- ended up requesting intents documentation from third-party apps and implementing our own intents strategy for deep-linking into the existing apps.
There are 2(as far as I know) possible ways to achieve this
Note - You would need access to the source code of the app you're trying to open for both the implementations
1. Integrate Deep links in the App to open the app if app is installed or visited the website otherwise.
2. Use firebase, add the app to the firebase and implement dynamic links.
I know it's possible to communicate with native android components via the Intent call, but I'm trying to figure out how to launch an app (which is installed) through an Adobe Air application.
Currently, thanks to Ben, I know that...
var url:String = ("intent:#Intent;" +
"action=android.intent.action.MAIN;" +
"category=android.intent.category.LAUNCHER;" +
"component=com.android.settings/.Settings;" +
"end");
navigateToURL(new URLRequest(url));
...launches the Android Settings menu through an Air app, which is awesome.
But I'm trying to launch an app...and I believe the secret lies within the "component=com.android.settings/.Settings;" snippet. Does anybody know how I can modify this code to launch an installed app on a device?
My kingdom for an answer. I've scoured the internet for days searching on this.
Brad
It depends on your use case.
If there's one specific app you want to open, you can look inside that app's .apk for the <intent-filter> elements, as explained in Launch custom android application from android browser. Then craft the appropriate URL to pass to navigateToUrl().
Another possibility is to get the package name for the app you want to open and set that as the component= section of your URL. Fair warning, I'm not actually sure if that will work.
If you don't know what app you want to open at compile-time, it's harder (e.g. if you have a server-side list of applications that your AIR app may need to invoke). Launch an application from another application on Android shows how to launch an application if you only know the package name, but you'll need a native extension to enable that functionality.
I am creating an app that i would like to have apps running within it like let's say an iframe on a website. Is this possible? For example i will open my app and it will show the Gallery of the phone but while running my app, and not just by opening the gallery app which will make my app minimized. I want it exactly like an iframe, is this possible?
you can not run another app within your own application. You can do any of the following two
start the other app by sending intent message
or create the other app's features similarly in your own app.
According to your question if your need is to create a gallery then why aren't you creating a own gallery in your app? that will be more easier and flexible
You can not run another app's Activities within your app in an iframe style for security reasons, sorry.
Yes, I believe that is is possible for Apps to run cross platform if there exist a common data framework that creates a uniform standard for how data is stored and referenced. So the data can exist in the cloud but referenced via each app independently of the mobile phone platform.
Is it possible to launch one app from another using Phonegap? We want to call a player app from a store app?
We also need the 2nd app to be able to return a variable to a script in the first app.
Cheers
Paul
Yes, it is possible but you'll probably end up needing to write a plugin to call an Android Intent. Many of the core PhoneGap API's like Camera use Intents.
http://developer.android.com/guide/topics/intents/intents-filters.html
http://wiki.phonegap.com/w/page/36753494/How%20to%20Create%20a%20PhoneGap%20Plugin%20for%20Android