title: how to get google api key for device
body: <p>I have created an application in Android based on Google Maps. I got an API key and it's running successfully in the emulator but when I run it on a device, it's showing a force close message.  Can someone please explain how to get an API key for use on a device and whether I have to get an API key specifically for device use at all?</p>
  
  <p>My Java code:</p>
  
  <pre><code>setContentView(R.layout.mapview);
  mapView = (MapView) findViewById(R.id.mapview);       
  mapView.setBuiltInZoomControls(true);
  
  String coordinates[] = {"9.966667", "78.166667"};
  double lat = Double.parseDouble(coordinates[0]);
  double lng = Double.parseDouble(coordinates[1]);
  GeoPoint  p = new GeoPoint((int) (lat * 1E6),(int) (lng * 1E6));
  
  MapController mapController = mapView.getController();
  
  mapController.setCenter(p);
  mapController.animateTo(p);
  mapController.setZoom(12);
  </code></pre>
  
  <p>My layout:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/main"
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" &gt;
  
      &lt;com.google.android.maps.MapView
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent"
          android:enabled="true"
          android:clickable="true"
          android:apiKey="myapikey" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Logcat error:</p>
  
  <pre><code> Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x1080215
  </code></pre>
  
  <p>This issue is a blocker on my project so I cannot move forward until it is fixed.</p>