wie können die map-api-key in android studio?
Ich bin mit Google map in mein Projekt, die Karte öffnen, aber nicht laden. Ich bin neu auf der android-studio,ich weiß nicht, wie map-key in android studio
Bitte helfen Sie mir.
manifest-Datei ist
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="com.truiton.supportmapfragment.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".activities.SplashScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.MainActivity" />
<activity
android:name=".activities.ForCustomer"
android:label="@string/title_activity_for_customer"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".activities.CustomerSignIn"
android:label="@string/title_activity_customer_sign_in"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".activities.Home"
android:label="@string/title_activity_home"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".activities.RegisterCustomer"
android:label="@string/title_activity_register_customer"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="I_REMOVED"/>
</application>
xml-Datei verwenden, wie dies
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#1B8AB7">
<ImageView
android:id="@+id/menu"
android:layout_width="40dp"
android:layout_height="25dp"
android:src="@drawable/menu"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"/>
<RelativeLayout
android:id="@+id/realtivelayout_search_bar"
android:layout_width="250dp"
android:layout_centerHorizontal="true"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:background="@drawable/saerchbarbackground"
>
<ImageView
android:id="@+id/btn_searchbar"
android:layout_width="35dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/search_btn"
android:layout_marginRight="5dp"/>
<EditText
android:layout_marginLeft="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:id="@+id/edittext_searchbar"
android:layout_toLeftOf="@+id/btn_searchbar"
android:hint=" search for location"
android:singleLine="true"
android:textColor="#000000"
android:background="#00000000"
/>
</RelativeLayout>
</RelativeLayout>
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header"
/>
</RelativeLayout>
Ich Verwendet, map-api, wie Sie sagte, aber die Karte nicht geladen wird, noch nicht.
Ich habe show @DanielNugent
Hallo Bruder, hilf mir @DanielNugent
Laden nicht heißt, dass graue Farbe?
prüfen Sie das link
fügen Sie Ihre xml-Datei
Hallo Bruder, hilf mir @DanielNugent
Laden nicht heißt, dass graue Farbe?
prüfen Sie das link
fügen Sie Ihre xml-Datei
InformationsquelleAutor Dalvinder Singh | 2015-12-24
Du musst angemeldet sein, um einen Kommentar abzugeben.
Müssen Sie Ihre Karte, geben Sie Ihre
AndroidManifest.xml
- Datei. Zwischen<application> </application>
tag.Finden Google-map-Integration in Android für ein besseres Verständnis. Kümmern sich um alle erforderlichen Berechtigungen für map-integration-in-manifest-Datei.
Erstellen google-api-Schlüssel, die Sie benötigen sha1-Schlüssel. Wenn Sie noch nicht erstellt. Sie können Folgen Sie SHA1-key in Android studio
Fügen Sie diese, bevor Sie Ihre
<application>
tag in manifest.posten Sie Ihre manifest-Datei und auch Ihren code. Nur dann können wir Ihnen helfen.
Ich habe SHA1-Schlüssel
können Sie mit mir chatten?
ja,wie kann ich dir helfen..
InformationsquelleAutor Beena
Versuchen, diese
bauen.gradle
und bitte erklären Sie mir, mit Beispiel.
InformationsquelleAutor Quang Doan
Hier sind die Holen Sie sich eine Google-Maps-API-Schlüssel und Anmeldung und API-Keys Dokumentationen, die Sie Folgen können, falls Sie verloren gehen hinzufügen
API_KEY
für Ihre app.Hier eine Zusammenfassung von dem, was Sie auf die links:
InformationsquelleAutor gerardnimo
überprüfen Sie folgenden code.
hinzufügen von map-fragment in xml-Datei.Es ist von funktionierendem code.
In der Aktivität
statt MapFragment verwenden supportMapFragment in beiden Dateien.
InformationsquelleAutor Prathap Badavath