Check if a package exists on Android Market
Asked Answered
S

3

22

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.

Scape answered 18/5, 2011 at 7:59 Comment(3)
Does this work since Android for Work supports the ability to publish company only apps? So it's my understanding you can only have the bundle on their once, but no one will see it other than the company's ability to distribute it thru their MDM. Searching the site publicly returns nothing normally so curious if any of these URL's would work in this case.Slovak
Note, that you can also get "Page not found" error if the application with this package name is banned by Google.Gaivn
the mentioned checks don't work in many cases because apps that are removed/not public won't show up despite being reserved.Utica
F
29

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.

Fem answered 18/5, 2011 at 8:25 Comment(4)
Thank you :) I know I can search the Web Market (see my post - I mentioned this option). My question was regarding the Market Application.Scape
You're My Angel.Agglutination
i did the same thing for my apps, but when i tried to upload the bundle, it shows the package name is takenDurango
Unfortunately this method is only indicative. If an application has been uploaded in the past with a package name and then removed from the store. The package name is not available but nothing is displayed on the page.Tensiometer
D
8

For details url and package name (https://play.google.com/store/apps/details?id=com.x.y.z)

Server returns

  • HTTP 200: package exists.
  • HTTP 404: package does exist
Dieppe answered 19/6, 2015 at 10:20 Comment(1)
jQuery always returns status 0. How can I use this with jQuery ? Any idea.Tabb
R
1

Both the accepted answer and other answer with links aren't working now (not sure if they did before). We're having an issue with one app (bundle already exists in Google Play, and those links return 404. My guess is if it's on internal testing and not publish that the bundle is already taken, but since app is not public, those links will return 404.

Rival answered 7/10, 2022 at 9:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.