Android Question [Solved] How to check if an app exists on Google Play Store

asales

Expert
Licensed User
Longtime User
I use this code to open an app in the Play Store:
B4X:
intent.Initialize(it.ACTION_VIEW, "market://details?id=com.mynewapp")
StartActivity(intent)

This app was removed and it is in a long review process.

How I can check If the app was published in Play Store before start the intent?

Thanks in advance for any tip.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Try to download the online page with OkHttpUtils2:
B4X:
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://play.google.com/store/apps/details?id=anywheresoftware.b4a.b4abridge2")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Else
    If j.Response.StatusCode = 404 Then
        Log("not exists")
    Else
        Log("other error")
    End If
End If
j.Release
 
Upvote 0
Top