• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Installed app package name?

Philleh

Lurker
Oct 16, 2010
6
0
Hi, does anyone know how you can find the package name for a particular app already installed on your handset? They usually go like: com.example.prototype

(Where the folder prototype cotains the runnable files)

Trying to use the intent function to launch an app within an app.

Was told putting this code in the onclicklistener method for the button would allow this, yet to test it successfully. I reckon it works, just need to figure out package name of the app I wanna launch.

Intent i = new Intent(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setPackage("com.otherapp.package");
startActivity(i);

Want to press a button, to launch the "com.otherapp.package"


Thanks!
 
I think you want to find an app that not must running, but just installed. The Running Services just list the running apps.

I think if you want to list all apps in your app, maybe you could try this:

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
 
  • Like
Reactions: Philleh
Upvote 0
I think you want to find an app that not must running, but just installed. The Running Services just list the running apps.

I think if you want to list all apps in your app, maybe you could try this:

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);

Sorry, double post :eek:

Hi, I don' want my app to list running services, I just need to know the package name of an app, so I can use the code I posted to run it from within that app? Maybe I'm unsure what your code does, but I don't think I need it
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones