0

Is there any way to launch for one mobile app to launch another mobile app, e.g. via a button click?

Example: the org.apache.cordova.camera plugin allows direct access to the camera on a button click. In the same way, how can one app launch another app?

Chris Johnson
  • 20,650
  • 6
  • 81
  • 80

3 Answers3

4

You can use this java code:

Intent LaunchIntent = this.cordova.getActivity().getPackageManager().getLaunchIntentForPackage("appPackage");
this.cordova.getActivity().startActivity(LaunchIntent);

or try any of these 2 plugins for launching apps:

Maxime Pacary
  • 22,336
  • 11
  • 85
  • 113
jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
1

Try this

Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("package name here");
startActivity( LaunchIntent );

If you don't know the package name of application that you want to launch then try this

PackageManager pm;
pm = getPackageManager();
//  get a list of all installed apps then launch by pakagename.
packages = pm.getInstalledApplications(0);

String packagename = packages.get(position).packageName.toString()

Refer this android-package-manager

Chirag Ghori
  • 4,231
  • 2
  • 20
  • 35
0

You need to find out full name of application, and then start it as activity via intent like this:

Intent myIntent = new Intent(getApplicationContext(), "full name of activity you are starting");
startActivity(myIntent);

You can even receive result from that activity check this. Hope this helps!

Community
  • 1
  • 1
Dejan
  • 3,046
  • 3
  • 28
  • 43