Android Question Try to check GooglePlayService

Pooya1

Active Member
Licensed User
Hi
I try call
B4X:
#AdditionalJar: com.google.android.gms:play-services-base
Sub CheckForGooglePlayServices As Boolean
   Dim GoogleApiAvailablity As JavaObject
   GoogleApiAvailablity = GoogleApiAvailablity.InitializeStatic("com.google.android.gms.common.GoogleApiAvailability").RunMethod("getInstance", Null)
   Dim context As JavaObject
   context.InitializeContext
   If GoogleApiAvailablity.RunMethod("isGooglePlayServicesAvailable", Array(context)) <> 0 Then
     GoogleApiAvailablity.RunMethod("makeGooglePlayServicesAvailable", Array(context))
     Return False
   End If
   Return True
End Sub
But when i try to compile simple project,it get below error
B4A Version: 8.30
Parsing code. (0.01s)
Compiling code. (0.04s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. Error
 

DonManfred

Expert
Licensed User
Longtime User
Make sure to load the MapFragment with the Layout.

- Add a MapFragment with the visual designer. It will appear under the CustomView menu. If you don't see it then make sure that the GoogleMaps library is selected.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Now i give small project for Erel
The one in #5? There is no library added which used Playservices.
Have you added any library that based on Google Play Services?

The project uploaded does not do anything.

The sub CheckForGooglePlayServices is never used. Away from this your project compiles and run fine here.
 
Upvote 0

Pooya1

Active Member
Licensed User
The one in #5? There is no library added which used Playservices.


The project uploaded does not do anything.

The sub CheckForGooglePlayServices is never used. Away from this your project compiles and run fine here.
Sir,
I test already this code in my project that the libraries(googlemap and other) is checked
The big problem is i cannot compile with blank project and cannot use code
For com.google.android.gms:play-services-base,what libraries need?
 
Upvote 0

Pooya1

Active Member
Licensed User
Hello again
Sorry for open this thread
But Again, I encountered an error
Actually while i update sdk to last version in B4a but i cannot compile empty project and after generate R line it was stop
I attach example source
 

Attachments

  • test.zip
    8.9 KB · Views: 206
Upvote 0
Top