Does anyone knows how can I open a native android app from a button in phonegap?
I'm creating an Activity that opens your phone apps so I need something to open the apps.
Thanks!
Create a plugin, that starts an Intent.
This blog may be a good entry:
http://tannerburson.com/blog/2012/05/28/IntentChooser-my-first-PhoneGap-Cordova-plugin/
Well if you want to open any native Android app then you'll need to write a plugin to call the apps Intent.
Although if you just want to open the Dialer app you can do:
<button onclick="document.location='tel:'">Phone</button>
and if can specify a phone number as well:
<button onclick="document.location='tel:411'">Phone</button>
Related
I have been asked to make an iOS / Android app that simply opens a website on full screen.
I have told them that, by using the iOS / Android native option to "Add to Homescreen" would accomplish the needs, but they insist on making it completelly automatic for the end-user.
Am I doomed to make both Apps for this need? Is there any way to "automatically create" or "share" an already created homescreen shortcut?
Thanks for your time.
Yes, you are doomed to make two apps, but you can start with a cross platform framework that can output to both platforms, allowing you to write it once. From how you describe this project I recommend starting with Cordova.
As maddy points out in the comment, an app that simply displays a website will be rejected by Apple. Yet if you encapsulate them website inside Cordova app, where the app need not access the website, or only access a website for updated information you will probably be approved.
I am learning react native and to do so, I am building my first app.
However as great as it is, It seems like react native has some limitations.
What I want my app to do is to start running the background as soon as the devise boots up (like the WhatsApp or the alarm app).
And I also want notification like WhatsApp new message notification (overlaying the screen).
I did it with android studio and wanted to do it with react native. So far I did not find any package / library that can do that, is this the limit of react native or is there a package that can do that? Because right now I am thinking of going back to native with android studio.
In android you must ask for necessary permissions in manifest. Also in the phone, you must set battery optimization. In Ios this is the hard one. I cannot do it. Your app must be music app or maps app. Thats all i know.
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