Android Question Google Map Android V2 Tutorial : Problem on Map_Ready

gragey

Member
Licensed User
Longtime User
The code si exactly the same than in the example. I try to test the différents fonctions of vb4a before doing my first application. Thank you very much

'Activity module
Sub Process_Globals

End Sub

Sub Globals
Dim mFragment As MapFragment
Dim gmap As GoogleMap
Dim MapPanel As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
MapPanel.Initialize("")
Activity.AddView(MapPanel, 0, 0, 100%x, 100%y)
If mFragment.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
Else
mFragment.Initialize("Map", MapPanel)
End If
End Sub
Sub Map_Ready
Log("map ready")
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
gmap.AddMarker(36, 15, "Hello!!!")
Dim cp As CameraPosition
cp.Initialize(36, 15, gmap.CameraPosition.Zoom)
gmap.AnimateCamera(cp)
End If
End Sub
 
Upvote 0

gragey

Member
Licensed User
Longtime User
Hello

In the programm :

MapPanel.Initialize("")
Activity.AddView(MapPanel, 0, 0, 100%x, 100%y)
If mFragment.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
Else
ToastMessageShow("Google Play services available.", True)
mFragment.Initialize("Map", MapPanel)
End If


I see the message "Google Play service Available" and I see the map
but I never see the message "Map Ready" in the sub :

Sub Map_Ready
Log("map ready")
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
gmap.AddMarker(45.82, 4.98, "Hello!!!")
ToastMessageShow("AddMarker", True)
Dim cp As CameraPosition
cp.Initialize(45.82, 4.98, gmap.CameraPosition.Zoom)
gmap.AnimateCamera(cp)
End If
End Sub


Thank you for your aid
 
Upvote 0

gragey

Member
Licensed User
Longtime User
I update the Android SDK Tools in version 22 and the Google Play service in version 14 and now when i compile
i have the error :

Parsing code. 0.00
Compiling code. 0.01
Compiling layouts code. 0.00
Generating R file. Error
invalid resource directory name: C:\Program Files (x86)\Android\extras\google\google_play_services\libproject\google-play-services_lib\res/drawable-xxhdpi

If you have an idea !

Thank you from France ...
 
Upvote 0

gragey

Member
Licensed User
Longtime User
Thank you for your messages

The problem was that the path for the file android.jar was no OK after the release of Android SDK Tools V22, Android SDK Platforms tools V19.0.1
and Google Play Service V14.
Now no compile error but always the same problem :

I see the map of the world in my application but i never go in the :

Sub Map_Ready procedure



Perhaps modifications to do in the manifest file ?

If hou have an idea ...
 
Upvote 0
Top