google map 认证指纹和API Key的获取

本文详细介绍了如何通过MD5指纹获取Google Maps API Key,并将其整合到Android应用的main.xml文件中,包括获取MD5指纹的方法、设置API Key的步骤以及相关注意事项。

1.网址  code.google.com/android/maps-api-signup.html

2.输入自己的MD5 指纹可以获取API Key.

3.MD5指纹的获取方法如下:

C:\Documents and Settings\gm\.android>keytool -list -alias androiddebugkey -keys
tore debug.keystore
输入keystore密码:
androiddebugkey, 2012-5-10, PrivateKeyEntry,
认证指纹 (MD5): 6D:04:82:A5:64:B1:35:BA:F6:D8:1A:11:DB:40:A7:10

4.然后在main.xml文件中

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/main"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <com.google.android.maps.MapView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="0UFYSeMNW5Tl718hzHQMstjDoqYNyM9UjetImsw"
        />
</LinearLayout>

5. 主文件内容为

package org.marsdroid.map01;

import android.os.Bundle;

import com.google.android.maps.MapActivity;

public class MainActivity extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

 @Override
 protected boolean isRouteDisplayed() {
  // TODO Auto-generated method stub
  return false;
 }
}

6.记住,在新建工程时,使用google API 的sdk. 新建模拟器时也要相应使用google API对应的模拟器。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值