Android Question [Action Recommended] Update to latest renderer for the Maps SDK for Android

Filippo

Expert
Licensed User
Longtime User
Hi,

I received this e-mail from Google yesterday.
Question, will the GoogleMaps be updated soon?

You may have projects using the legacy renderer that will be decommissioned by March 3, 2025. Apps built with the Maps SDK for Android will be automatically updated to the latest renderer beginning March 4, 2024.

Hello Google Maps Platform Customer,


This is a follow up to the announcements sent in 2021 and 2022 regarding the new renderer for Maps SDK for Android. To provide an improved user experience and app performance, apps built with the Maps SDK for Android will be automatically updated to the latest renderer beginning March 4, 2024. The legacy renderer is scheduled for decommissioning on March 3, 2025.


What do I need to know?​


The new renderer was introduced in Maps SDK for Android version 18.0 in an opt-in manner. It is offered as a default starting on version 18.2, with an option to specify the Legacy renderer (Renderer.LEGACY).


Your app may be currently using the legacy renderer in two situations.


  • Situation 1.If you use Maps SDK for Android version < 18, or 18.0-18.1 without opting in the new renderer:
    • The automatic update to the latest renderer will be rolled out to the Android devices in a gradual ramp up mode and is expected to impact 100% of all supported devices by the end of 2024.

  • Situation 2.If you specify the legacy renderer (on version 18.0 or later):
    • Your application will continue receiving the legacy renderer until March 2025. Starting in March 2025, you will get the new renderer even if you specify the Legacy renderer.

During the migration period, Google will continue to provide support and fixes to major bugs and outages on the legacy renderer. New features and improvements are only offered on the new renderer.


The new renderer is currently only available on Android phones. If your app is used on Wear OS or Android Go, the new renderer will be available in Google Play Services at a later time. Please follow the progress on this rollout by starring this issue tracker entry.


What do I need to do?​


No action is recommended if your app already uses Maps SDK for Android v18.2.0 and does not specify a renderer during the initialization process.


Updating to the latest renderer in the Maps SDK for Android may introduce a slight change to the performance and behavior of the maps in your app. Google does not expect this to cause any operational issues.


We recommend that developers of mission-critical apps test their application with the new renderer ahead of the automatic update (happening in March 2024 or March 2025 depending on your situation above), in order to limit risks of potential issues. You can do this by updating the dependencies for your app to the Maps SDK for Android version 18.2.0 or later, without specifying the Legacy renderer (Renderer.LEGACY).
 

DonManfred

Expert
Licensed User
Longtime User
I started doing a new wrapper for googlemaps some months ago but were not able to test it.

The new one is using this initialization
B4X:
com.google.android.gms.maps.MapsInitializer.initialize(ba.context, Renderer.LATEST, this);
which refers to the newest Renderer to use.

It should work work with the above requirements.

Want to test it?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Open B4A Sdk Manager and update com.google.android.gms:play-services-maps to version 18.2.0. Don't update anything else.
2. That's it.
3. If for some reason you want to keep on using the legacy renderer then call this sub:
B4X:
'call this before loading the layout, if you want to use the legacy maps renderer.
Private Sub InitializeWithLegacyRenderer
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Dim MapsInitializer As JavaObject
    MapsInitializer.InitializeStatic("com.google.android.gms.maps.MapsInitializer")
    Dim Renderer As JavaObject
    Renderer.InitializeStatic("com.google.android.gms.maps.MapsInitializer.Renderer")
    Dim SdkInitializedEvent As OutputStream = Renderer.CreateEventFromUI("com.google.android.gms.maps.OnMapsSdkInitializedCallback", "SdkInitializedEvent", Null)
    MapsInitializer.RunMethod("initialize", Array(ctxt, Renderer.GetField("LEGACY"), SdkInitializedEvent))
End Sub

Private Sub SdkInitializedEvent_Event (MethodName As String, Args() As Object) As Object
    Log(MethodName)
    Log(Args(0))
    Return Null
End Sub
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
1. Open B4A Sdk Manager and update com.google.android.gms:play-services-maps to version 18.2.0. Don't update anything else.
2. That's it.
3. If for some reason you want to keep on using the legacy renderer then call this sub:
B4X:
'call this before loading the layout, if you want to use the legacy maps renderer.
Private Sub InitializeWithLegacyRenderer
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Dim MapsInitializer As JavaObject
    MapsInitializer.InitializeStatic("com.google.android.gms.maps.MapsInitializer")
    Dim Renderer As JavaObject
    Renderer.InitializeStatic("com.google.android.gms.maps.MapsInitializer.Renderer")
    Dim SdkInitializedEvent As OutputStream = Renderer.CreateEventFromUI("com.google.android.gms.maps.OnMapsSdkInitializedCallback", "SdkInitializedEvent", Null)
    MapsInitializer.RunMethod("initialize", Array(ctxt, Renderer.GetField("LEGACY"), SdkInitializedEvent))
End Sub

Private Sub SdkInitializedEvent_Event (MethodName As String, Args() As Object) As Object
    Log(MethodName)
    Log(Args(0))
    Return Null
End Sub
What about B4i?
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
1. Open B4A Sdk Manager and update com.google.android.gms:play-services-maps to version 18.2.0. Don't update anything else.
since SDK manager is seldom used, it gave me a "sdkmananager.bat not found" error.
will the resources zip from the B4X download page will be updated as well, so we won't need to use SDK manager?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
will the resources zip from the B4X download page will be updated as well, so we won't need to use SDK manager?
Yes but it might take some time.

It should be simple to solve the "sdkmananager.bat not found" error. You just need to point to:
B4X:
<android sdk>\cmdline-tools\bin\sdkmanager.bat
 
Upvote 0
Top