android - 谷歌授权

标签 android google-authentication

我是基于谷歌地图的应用程序的新手,正在尝试使用它。我使用了 mainfest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.abhishekbietcs.locomap"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />
<permission
      android:name="com.abhishekbietcs.locomap.permission.MAPS_RECEIVE"
      android:protectionLevel="signature"/>
    <uses-permission android:name="com.abhishekbietcs.locomap.permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_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" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />


<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.abhishekbietcs.locomap.Mapme"
        android:label="@string/title_activity_mapme" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="my key" />
</application>

我从这段代码中得到了我的调试证书 sh1 fngrprint

keytool.exe -list -alias androiddebugkey -keystore ".....\.android\debug.keystore" -storepass android -keypass android -v

这是我的xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Mapme" >
<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.SupportMapFragment"/>

现在当我在我的手机上安装时,log cat 中出现 google 授权失败。请帮助我找出我做错的地方,在此先感谢

最佳答案

在创建使用 Google Maps API 的应用程序之前,您必须执行几个步骤:

  • 在 Google API 控制台中创建 Google API 项目 ( https://code.google.com/apis/console )
  • 为 Android 启用 Google Maps API(在“服务”标签中)
  • 创建新的客户端 ID(您应该输入 SHA1 key 和您的应用程序包名称)

你都做到了吗?如果是,请提供logcat输出,其中包含有关授权失败的信息。

关于android - 谷歌授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14789458/

相关文章:

java - 以编程方式使 Android 可穿戴设备静音

android - SmsManager 在三星设备上崩溃

android - 错误:错误:找不到(3,10) 'opencv2/opencv.hpp'文件

android - SHA 1 哈希键对所有应用程序都相同吗?

go - 使用服务帐户从 Google REST API 获取数据

google-app-engine - 用Python实现谷歌云机器学习引擎的在线预测

javascript - 如何确定用户是否关闭了 google auth2.signIn() 窗口?

android - Android Logcat无限消息

php - 使用PHP和Android访问mysql数据库

youtube - 无需 Oauth2 从 Youtube Analytics API 读取数据