Getting Started
Download and install Android Studio
Follow the guidelines download and Install Android Studio. (Note: The download address is the official Google website)
Get AK
Create a project
Follow the steps below to create an application for an Empty Activity.
Start Android Studio. If you see the Welcome to Android Studio dialog, select Start a new Android Studio project, otherwise, click File in the Android Studio menu bar, then click New->New Project, and enter your app name, company domain when prompted. And project location. Then click Next.
Select the model you want for your app. If you're not sure what you need, just choose Phone and Tablet. Then click Next.
Select Empty Activity in the "Add an activity to Mobile" dialog. Then click Next.
Enter the Activity name, layout name, and title as prompted. Use the default value. Then click Finish.
Download and install the map development kit
Download and unzip the development kit from the official website.
Please refer to the steps in the SDK for adding SDK-related JAR packages in the project configuration and description in the development guide.
Project Configuration
1. Add permissions to AndroidManifest.xml
To ensure the normal operation of the program, you need to add the corresponding usage rights in the configuration file AndroidManifest.xml, the code is as follows:
<!-- Allow programs to open network sockets --> <uses-permission android:name="android.permission.INTERNET" />
2. Add Android version support in AndroidManifest.xml
Based on SDK development, Android2.3 and above are required. You need to make the following settings in AndroidManifest.xml, for example:
<user-sdk android:minSdkVersion="9"/>
Connect to an Android device
The easiest way to understand how your app actually works is to connect your Android device to your computer. Follow the instructions to enable developer options on your Android device and configure your app and system to detect devices.
Also, you can use the Android emulator to run your app. Use the Android Virtual Device (AVD) Manager to configure one or more virtual devices, and you can use your device with the Android emulator to build and run your app.
Build and run your app
In Android Studio, click the Run menu option (or the play button icon) to run your app.
When you are prompted to select a device, choose one of the following options:
Select an Android device connected to your computer. Alternatively, select the Launch emulator radio button and select the virtual device you have previously configured. Click OK. Android Studio will call Gradle to build your app and display the results on the device or emulator. It may take a few minutes for the app to open.
You can see a map display in your project. If you don't see the map, check if you are connected. If you see the map but can't use POI search and path planning and other related functions, please confirm whether you have added your AK in AndroidManifest.xml.