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
  • 19,032
  • 5
  • 75
  • 76

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:

Frosty Z
  • 21,350
  • 10
  • 81
  • 110
jcesarmobile
  • 48,897
  • 10
  • 119
  • 162
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,135
  • 2
  • 18
  • 34
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
  • 1,688
  • 2
  • 22
  • 37