Hello SDK¶
In this guide you will learn how to create a Hello World app using the Maps SDK for Android.
Setup¶
First, get an API key token, see the Getting Started guide.
Download the Maps & Navigation SDK for Android archive fileDownload the HelloSDK project
archive file or clone the project with Git
See the Configure Android Example guide.
Run the example¶
In Android Studio, from the File
menu, select Sync Project with Gradle Files
How it works¶

You can open the MainActivity.kt file to see how to create an empty app and import the Maps SDK for Android.
1// Kotlin code
2import android.content.pm.PackageManager
3import android.os.Bundle
4import androidx.appcompat.app.AppCompatActivity
5
6import com.generalmagic.sdk.examples.util.SdkInitHelper
7import com.generalmagic.sdk.examples.util.SdkInitHelper.terminateApp
8
9class MainActivity : AppCompatActivity()
10{
11 override fun onCreate(savedInstanceState: Bundle?)
12 {
13 super.onCreate(savedInstanceState)
14 setContentView(R.layout.activity_main)
15 val app = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA)
16 val token = app.metaData.getString("com.generalmagic.sdk.token") ?: "YOUR_TOKEN"
17 if (!SdkInitHelper.init(this, token))
18 {
19 // The SDK initialization was not completed.
20 finish()
21 }
22 }
23 override fun onDestroy()
24 {
25 super.onDestroy()
26 // Deinitialize the SDK.
27 SdkInitHelper.deinit()
28 }
29 override fun onBackPressed()
30 {
31 terminateApp(this)
32 }
33}
import com.generalmagic.sdk.examples.util.SdkInitHelper
import com.generalmagic.sdk.examples.util.SdkInitHelper.terminateApp
MainActivity
overrides the onCreate
function whichSdkInitHelper.init(this, token)