Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find package name for Android apps to use Intent to launch Market app from web

I'm creating a mobile website that will include a page from which people can download relevant apps that we recommend. I've found instructions for creating the links to launch the Market but this assumes that you are the developer of the app in question and know the exact package name.

Is there any way to get the package name, other than just contacting the developers and asking?

Also, it turns out that those instructions don't really work for creating web hyperlinks. They only give you a URI to reference in a string of Java code in another Android app. Our site is in Drupal, so Java is not going to work.

For the iPhone, I found easy instructions for getting the URL/link style I need from the iTunes store, so I'm looking for info like that.

like image 429
eom Avatar asked May 07 '10 14:05

eom


People also ask

What should be the package name of an Android app?

The package name of an Android app uniquely identifies your app on the device, in Google Play Store, and in supported third-party Android stores.

How do I find my Android package name?

One method to look up an app's package name is to find the app in the Google Play app store using a web browser. The package name will be listed at the end of the URL after the '? id='.

How do I launch an app 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 find the package name of an APK?

A simple solution would be Open Android Studio -> Build -> Analyze Apk... browse and select the APK now you can find the package name and pretty much you can read. Show activity on this post. You can use Analyze APK... from the Build menu in Android Studio, it will display the package name at the top of new window.


1 Answers

It depends where exactly you want to get the information from. You have a bunch of options:

  • If you have a copy of the .apk, it's just a case of opening it as a zip file and looking at the AndroidManifest.xml file. The top level <manifest> element will have a package attribute.
  • If you have the app installed on a device and can connect using adb, you can launch adb shell and execute pm list packages -f, which shows the package name for each installed apk.
  • If you just want to manually find a couple of package names, you can search for the app on http://www.cyrket.com/m/android/, and the package name is shown in the URL
  • You can also do it progmatically from an Android app using the PackageManager

Once you've got the package name, you simply link to market://search?q=pname:<package_name> or http://market.android.com/search?q=pname:<package_name>. Both will open the market on an Android device; the latter obviously has the potential to work on other hardware as well (it doesn't at the minute).

like image 76
Chris Avatar answered Sep 22 '22 15:09

Chris