Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Problem in showing MapView
    text
    copied!<p>I want to show Map on my android emulator. I have found one sample application HelloMaps in android API 7. I have created API key and pasted that key in the <code>MapView</code> layout. Below is code for <code>mapview.xml</code>.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p></p> <pre><code> &lt;com.google.android.maps.MapView android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="my_API_key_here" /&gt; </code></pre> <p></p> <p>Following is code for in HelloGoogleMaps.java</p> <pre><code> public class HelloGoogleMaps extends MapActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MapView mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); } @Override protected boolean isRouteDisplayed() { return false; } } </code></pre> <p>And following is manifest file code.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p></p> <pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".HelloGoogleMaps" 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;uses-library android:name="com.google.android.maps" /&gt; &lt;/application&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; </code></pre> <p></p> <p>With above code I am just able to see background area of Map but not actual Map. Please help me If I am missing something.</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