Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a package exists on Android Market

I am trying to find if a specific package already exists in Android Market.

I know I have no problem to actually open the Market application in the package page:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=" + PACKAGE_NAME));
startActivity(intent);

But I want to know if it exists before I try this - so the user won't get the default "not found" market page.

One way to do it, of course, is to use the web Market URL with an HttpClient (https://market.android.com/details?id=) - this will return 404 if the package does not exist.

However, I'm looking for a way to do that with the Market application installed on the device.

like image 364
Erez A. Korn Avatar asked May 18 '11 07:05

Erez A. Korn


People also ask

How do I find installed packages on Android?

To list all the installed packages on an Android device, use the following syntax. To list only the system packages, use the “ -s ” option. To list only 3rd party (or non-system) packages, use the “ -3 ” option. To list the package names as well as the path to the installed APK files, use the “ -f ” option.

How do I know if Whatsapp is installed on Android?

Check condition like this.if(! appInstalledOrNot("com. whatsapp")){ // Toast message not installed. } else{ // Toast message installed. }

What is the package name of Google Play store?

@maveň It actually is com. android. vending .


1 Answers

You can perform a simple test on the Android market URL as

https://play.google.com/store/apps/details?id=com.mycompany.myapp

Pass your Application Package name with the letters indented in bold letters in above URL, if you get any result then it is concluded that the Application Package name is already been used, if you get "We're sorry, the requested URL was not found on this server." then you can use the app package name.

like image 170
Vinayak Bevinakatti Avatar answered Sep 21 '22 05:09

Vinayak Bevinakatti