Note that there are some explanatory texts on larger screens.

plurals
  1. POI have created an Android Map API key for V2, can't display a map
    text
    copied!<p>I have created a Google API key for version two and used that in the manifest, but I'm unable to display map on the device.</p> <p>I have followed everything provided in google map documentation. also I used <a href="https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw" rel="nofollow">this link</a>. </p> <p><strong>MainActivity.java.</strong> </p> <p>package com.example.googlenewmap;</p> <pre><code> import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MainActivity extends FragmentActivity { static final LatLng HAMBURG = new LatLng(53.558, 9.927); static final LatLng KIEL = new LatLng(53.551, 9.993); private GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); map = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); if (map != null) { map.addMarker(new MarkerOptions().position(HAMBURG) .title("Hamburg")); map.addMarker(new MarkerOptions() .position(KIEL) .title("Kiel") .snippet("Kiel") .icon(BitmapDescriptorFactory .fromResource(R.drawable.ic_launcher))); } } } </code></pre> <p><strong>Manifest File</strong></p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.googlenewmap" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" /&gt; &lt;permission android:name="com.example.googlenewmap.permission.MAPS_RECEIVE" android:protectionLevel="signature" /&gt; &lt;uses-permission android:name="com.example.googlenewmap.permission.MAPS_RECEIVE" /&gt; &lt;!-- Copied from Google Maps Library/AndroidManifest.xml. --&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt; &lt;!-- External storage for caching. --&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;!-- My Location --&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;!-- Maps API needs OpenGL ES 2.0. --&gt; &lt;!-- Maps API needs OpenGL ES 2.0. --&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt; &lt;!-- End of copy. --&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;!-- ** You need to replace the key below with your own key. ** The example key below will not be accepted because it is not linked to the certificate which you will use to sign this application. See: https://developers.google.com/maps/documentation/android/start for instructions on how to get your own key. --&gt; &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="api key" /&gt; &lt;activity android:name="com.example.googlenewmap.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>How can I fix this problem?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload