androidgoogle-mapsdelphirad-studiomapview

RAD Studio TMapView Component can't working properly


I am learning to build Android Google Map app on RAD Studio 11. However, I got crush when the app is being launched. If I change the API key point to another package name, the app can be launched but the map is empty.

Do anyone know what is the matter? How could I fix the problem? Many thanks in advance.

Regards, Kenny


Solution

  • First, an API key is mandatory.

    You need to create a project in Google Cloud Platform and enable Maps SDK for Android. When it's done you will get an API key.

    On your Firemonkey application, you can add a TMapView.

    In project options > Application > Version info. > add a new line, with key apiKey and value the api key you get from Google.

    You need to also check the Maps checkbox in the Entitlements List in the Project Options.

    That's all. You can do it in All configuration or only Android 32/64 bits.

    Check what version you run, and set the apiKey correctly.

    Otherwise, this page describe you what I told : https://docwiki.embarcadero.com/RADStudio/Sydney/en/Mobile_Tutorial:_Using_a_Map_Component_to_Work_with_Maps_(iOS_and_Android)

    If the Map is empty, it's possible that you didn't use the correct API.