Launch external app android

1.4k Views Asked by At

I am building an application using ionic and cordova. I am trying to open an external application to which source code I dont have any access. I only know the package name. Is what I am trying to do actually possible?

CDV.WEBINTENT.startActivity({
     action: CDV.WEBINTENT.ACTION_VIEW,
     url: "content://com.test.123.GameActivity"
},
function() {},
function() {
     alert('Failed to open URL via Android Intent')
});
1

There are 1 best solutions below

0
Daniel Marcos On

Have you looked at this tutorial?

how-to-launch-external-application-with-ionic-framework

And if that helps, this is how you would do it in Java:

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

startActivity(launchIntent);