Android Question White map, google maps not work.

Calvin Yee

Member
Licensed User
Googlemap.apk - tested, working.

Please advise.
Thank you.

manifest:-
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")
SetApplicationAttribute(android:largeHeap,"true")
AddApplicationText(
<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="AIzaSyDIbmbyuijOgRwYNLIGQjukV29Pc_y9iKs"/>
)

GPS collection code as below:-
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("lyCollectGPS")
    If MapFragment1.IsGooglePlayServicesAvailable = False Then
        ToastMessageShow("Please install Google Play Services.", True)
      End If
End Sub
Sub MapFragment1_Ready
    gmap = MapFragment1.GetMap
    Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    gmap.GetUiSettings.MyLocationButtonEnabled=True
    Dim m1 As Marker = gmap.AddMarker(10, 30, "test")
    m1.Snippet = "This is the snippet"
End Sub
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
    If Permission = Starter.rp.PERMISSION_ACCESS_FINE_LOCATION Then
        gmap.MyLocationEnabled = Result
    End If
End Sub
 

Attachments

  • white map.png
    white map.png
    42.1 KB · Views: 190

Calvin Yee

Member
Licensed User
I already follow the the below link still is the same:-

The output still is white map.

Please advise.


- Register your app in Google developer console: https://console.developers.google.com
You need to enable Google Maps Android API.
Then click on Credentials -> Create Credentials -> API Key -> Android Key.
You should get a key that looks like: AIzaSyCmFHamGE0O0BvxxxxxxxxXbTCSrjFVg-Q

B4X:
[QUOTE="DonManfred, post: 657182, member: 42649"]Follow the instructions here, it will work.
https://www.b4x.com/android/forum/threads/google-maps.63930/[/QUOTE]
 
Upvote 0

wizard699

Active Member
Licensed User
Longtime User
Erel, but WHAT API from GOOGLE CLOUD PLATFORM activate EXACTLY?

MAPS JAVASCRIPT API or
MAPS SDK FOR ANDROID ?
 
Upvote 0
Top