Basic Process of applying google map to android apps

Source: Internet
Author: User

Before use

Google Maps bring great convenience to people's lives. For example, google maps can be used to search for merchant information, view maps, and obtain vehicle routes. The android platform also provides a map package (com. google. android. maps), where mapview allows you to conveniently program using google map resources. Make the following necessary settings before use.

(1) Add maps. jar to the Project

In the android sdk, map-related APIs are provided in the form of a jar library, which is in the directory of "android-sdk-windows \ add-ons \ google_apis-4. To add maps. jar to a project, you can specify the target containing google api in the "android" column of the Project attribute as the project building target.

(2) embedding a map into an application

By using the mapactivity and mapview controls, you can easily embed a map into an application. In this step, you need to add the google api to the build path. Select "java build path" on the page shown in Figure 12-4, select google api in target, and set the project to contain google api

(3) obtain the map api key

Before using mapview, you must apply for an android map api key as follows.

Step 2: Find Your debug. keystore file, which is usually located in the following directory.

C: \ documents and settings \ your current user \ local settings \ application data \ android

Step 2: Obtain the md5 fingerprint. Run cmd.exe and run the following command to obtain the md5 fingerprint.

> Keytool-list-alias androiddebugkey-keystore "debug. keystore path"-storepass android-keypass android

For example, enter the following command.

Keytool-list-alias androiddebugkey-keystore "c: \ documents and settings \ administrator \. android \ debug. keystore"-storepass android-keypass android

At this time, the system will prompt you to enter the keystore password, and then enter android, the system will output the Requested md5 authentication fingerprint

Step 2: apply for the api key of android map.

Android/maps-api-signup. html

On the google android map api key application page, enter the md5 fingerprint obtained in Figure 12-6 and press the "generate api key" button to go to the following figure, obtain the applied api key

At this point, an api key is obtained successfully, and the entire preparation before programming is completed.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.