Android developer _ map app _ Baidu map-1

Source: Internet
Author: User

Go straight to the topic !!!

Steps for developing an application based on Baidu map on an Android device:

1. Download the android SDK:

Http://dev.baidu.com/wiki/imap/index.php? Title = Android % E5 % B9 % B3 % E5 % 8f % B0/% E7 % 9B % B8 % E5 % 85% B3 % E4 % B8 % 8B % E8 % BD

2. Apply for Baidu map API key:

Http://dev.baidu.com/wiki/static/imap/key/

3. Create an android project and add the jar package and so Library (the storage path of the so library is res/libs/Armeabi)

4. Add the mapview component to the layout file.

Note: For jar packages of different versions, the directory where mapview is located may be adjusted.

5. Create an activity

The most basic applications require three related classes: bmapmanager, mapview, and mapcontroller.

Note: The bmapmanager object initialization must be completed before the setcontentview method. Otherwise, an exception occurs in COM. Baidu. mapapi. Map. mapview failed to instantiate.

If the map is not displayed clearly, add:

<Supports-screens
Android: anydensity = "true"
Android: largescreens = "true"
Android: normalscreens = "false"
Android: resizeable = "true"
Android: smallscreens = "true"/>

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.