Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start application knowing package name

Tags:

android

How can i start a new application using its package name? I don't have information about what activity is the main one.

like image 223
bart Avatar asked Aug 06 '10 10:08

bart


People also ask

How do I launch an application using package name?

Just use these following two lines, so you can launch any installed application whose package name is known: Intent launchIntent = getPackageManager(). getLaunchIntentForPackage("com. example.

How do I know my package name application?

You can find an app's package name in the URL of your app's Google Play Store listing. For example, the URL of an app page is play.google.com/store/apps/details? id=com. example.

What is application package name?

All Android apps have a package name. The package name uniquely identifies the app on the device; it is also unique in the Google Play store.

Is package name and application ID same in Android?

The applicationId exactly matches the Java-style package name you chose during project setup in android studio. However, the application ID and package name are independent of each other beyond this point.


1 Answers

Just use these following two lines, so you can launch any installed application whose package name is known:

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.example.abc"); startActivity( launchIntent ); 

If you don't know the package name of application that you wanted to launch then try your hand on:

PackageManager pm; pm = getPackageManager(); //  get a list of installed apps. packages = pm.getInstalledApplications(0); 

For more information, refer to this link: Using Package Manager.

like image 70
patric_cena Avatar answered Oct 13 '22 20:10

patric_cena