I'm trying to see the map on the screen. I did everything as in your example, but an error appears
[CODE lang="b4x" title="Google map"]#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private gmap As GoogleMap
Private MapFrag As MapFragment
Private pnl As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
pnl.Initialize("")
Activity.AddView(pnl,0%x,0%y,100%x,100%y)
MapFrag.Initialize("MapFrag",pnl)
Wait For MapFrag_Ready
gmap = MapFrag.GetMapEnd Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub MapFrag_Click (Point As LatLng)
gmap.AddMarker(Point.Latitude, Point.Longitude, "New Marker")
End Sub[/CODE]
Manifrst Editor
[CODE lang="b4x" title="Manifest"]'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
'SetApplicationAttribute(android:icon, "@icon")
SetApplicationAttribute(android:label, "Giperbola")
SetApplicationAttribute(android:largeHeap,"true")
SetApplicationAttribute(android:usesCleartextTraffic,"true")
CreateResourceFromFile(Macro, Themes.LightTheme)
AddPermission("android.permission.ACCESS_NOTIFICATION_POLICY")
AddPermission("android.permission.MOUNT_UNMOUNT_FILESYSTEMS")
AddPermission("android.permission.ACCESS_NETWORK_STATE")
AddPermission("android.permission.INTERNET")
AddPermission("android.permission.RECORD_AUDIO")
'AddPermission("android.permission.READ_PHONE_STATE")
AddPermission("android.permission.RECORD_AUDIO")
AddPermission("android.permission.ACCESS_FINE_LOCATION")
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAaphCMm3ns-2TQQQQQQQQQQQQQQQQQQQW5dc4"/>
)
AddApplicationText(
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
)[/CODE]