Google Maps Android API V2 Android Google map v2

Source: Internet
Author: User
 
 

Getting the Google Maps Android API V2 is now upgraded to V3 by Google map API. V2 is popular. V1 has been marked as obsolete.

The Demo code is located in SDK extras/Google/google_play_services/samples/maps

Google Code
Console address

  1. First download the Google Play Service SDK. Download Android SDK
  2. The API key obtained is different from that obtained by V1. Note:
  3. Application manifest settings

Google says Note:
Google Maps Android API V2 uses a new system of managing keys. existing keys from a Google Maps Android V1 application, commonly known as mapview, will not work with the V2 API. the key systems of generation 2 and generation 2 are different and not universal.

keytool  -v -list  -keystore key.keystore

Copy the sha1 fingerprint



On the left side of the console, click API access. Create new Android key at the bottom of the page. Copy the fingerprint. Note that the format is "fingerprint; package name"


Then create the following

Then you get the API key.
Next, go to mainfest. xml.

 
<Meta-data Android: Name = "com. google. android. maps. v2.api _ key "Android: value =" your_api_key "/> Add required permissions to <permission Android: Name =" com. example. mapdemo. permission. maps_receive "Android: protectionlevel =" signature "/> <uses-Permission Android: Name =" com. example. mapdemo. permission. maps_receive "/> <uses-Permission Android: Name =" android. permission. internet "/> <uses-Permission Android: Name =" android. permission. W Rite_external_storage "/> <uses-Permission Android: Name =" com. google. android. providers. GSF. permission. read_gservices "/> <uses-Permission Android: Name =" android. permission. access_coarse_location "/> <uses-Permission Android: Name =" android. permission. access_fine_location "/> V2 requires OpenGL. Therefore, add the <uses-feature Android: glesversion =" 0x00020000 "Android: required =" true "/> XML Sample Code <? XML version = "1.0" encoding = "UTF-8"?> <Fragment xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Id = "@ + ID/Map" Android: layout_width = "match_parent" Android: layout_height = "match_parent" class = "com. google. android. GMS. maps. mapfragment "/>

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.