Android Question Does not enter Map_Ready Sub [Solved]

Roger Daley

Well-Known Member
Licensed User
Hi All,

Still trying to upgrade an existing App to the new Google maps requirements.
I cautiously think I have followed Erels tutorial correctly but the App still does not work.
I have tracked the problem to the program not entering the Map_Ready Sub. I have found only one previous question on this with the apparent solution an OS upgrade; as this was several years ago and I am running Android V8.0 I don't think this is the issue.

Attached is a Zip of the program and below is the manifest.

Any help gratefully received

Regards Roger


B4X:
'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: http://www.basic4ppc.com/forum/showthread.php?p=78136

 'Changed line as part of upgrade 10 Aug 19
'<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28"/>
'<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$")

'This line added as part of upgrade 10 Aug 19
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
'SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
'End of default text.


'
AddApplicationText( <meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" /> )

AddManifestText( <permission
          android:name="$PACKAGE$.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/>
      <uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
 
   'Changed line as part of upgrade 10 Aug 19
    ' android:name="com.google.android.maps.v2.API_KEY"
AddApplicationText(<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="AIzaSyAn4mAf8Nqha2H5oHHYvbCx9Ge37PADBYY"/>)
'<meta-data android:name="com.google.android.gms.version"
'android:value="@integer/google_play_services_version"
'    />)
 
 
AddPermission(android.permission.ACCESS_NETWORK_STATE)
 

marcick

Well-Known Member
Licensed User
I wante dto help but It's difficult to investigate on a large project. I would reccomend you to start a blank GoogleMap project (or start from the tutorial) and see if it works.
Then, you'll propably see by yourself where is the problem ....
 

Roger Daley

Well-Known Member
Licensed User
I wante dto help but It's difficult to investigate on a large project. I would reccomend you to start a blank GoogleMap project (or start from the tutorial) and see if it works.
Then, you'll propably see by yourself where is the problem ....

Thanks Marcick

I've already built a program from the tutorial looking at an earlier problem. It works, tells me nothing about this problem.

Regards Roger
 

Roger Daley

Well-Known Member
Licensed User
Marcick and Erel,

Thankyou gentlemen, spot on. I tripped over the legacy code.
Previously when the MapFragment was not generated in the designer I had initialized it with "mFragment.Initialize("Map", MapPanel)".
Now that this part is working, I will go through and correct any others, like Map_CameraChange etc.
I'm sure there will be more.

Regards Roger



Spot on
 
Top