Android Question Playstore installed

Giusy

Active Member
Licensed User
Hi,
how to know if the user has playstore installed in his phone?
Thank you
 
Hi @Ohanian
In this code:
Code: Copy
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim jo As JavaObject
jo = jo.InitializeStatic("com.google.android.gms.common.GoogleApiAvailability").RunMethodJO("getInstance", Null)
Dim status As Int = jo.RunMethod("isGooglePlayServicesAvailable", Array (ctxt))
I have this error in the last row
 

Attachments

  • ERROR.JPG
    ERROR.JPG
    68.1 KB · Views: 335
Upvote 0
Hi @Ohanian
In this code:
Code: Copy
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim jo As JavaObject
jo = jo.InitializeStatic("com.google.android.gms.common.GoogleApiAvailability").RunMethodJO("getInstance", Null)
Dim status As Int = jo.RunMethod("isGooglePlayServicesAvailable", Array (ctxt))
I have this error in the last row

Hi,

add this line to the main :
Code: Copy
#AdditionalJar: com.google.android.gms:play-services-base

and put these lines in the manifest :

Code: Copy
'************ Google Play Services Base ************
AddApplicationText(
   <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
    <meta-data
  android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************

and the status code is one these values :
Code: Copy
https://developers.google.com/android/reference/com/google/android/gms/common/ConnectionResult
 
Upvote 0
@Ohanian,
now it run correctly. thanks
I have on my device playstore installed and the status return 0
It's correct?

yes that's correct.

Code: Copy
public static final int SUCCESS
The connection was successful.

Constant Value: 0
 
Upvote 0
Back
Top