title: Android 2.3 and google maps API v2
body: <p>Today I tried to use google maps api v2 for Android 2.3.3
  My steps:</p>
  
  <ul>
  <li>got SHA1 code from debug.keystore</li>
  <li>create a new project in google apis console</li>
  <li>register a new id</li>
  <li>enabled google maps android api v2</li>
  <li>create an android key using as input SHA1;it.mappe   (it.mappe is my
  package)</li>
  <li>get API key</li>
  <li><p>update AndroidManifest file:</p>
  
  <pre><code>&lt;permission android:name="it.mappe.permission.MAPS_RECEIVE" android:protectionLevel="signature" /&gt;
  
  &lt;uses-permission android:name="it.mappe.permission.MAPS_RECEIVE" /&gt;
  &lt;uses-sdk android:minSdkVersion="10" android:targetSdkVersion="16" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
  
  &lt;uses-feature android:glEsVersion="0x00020000" android:required="true"` /&gt;
  
  &lt;application     android:allowBackup="true"    android:icon="@drawable/ic_launcher"  android:label="@string/app_name"  android:theme="@style/AppTheme" &gt;
      &lt;meta-data
          android:name="com.google.android.maps.v2.API_KEY"
          android:value="MY_KEY" /&gt;
  
          &lt;activity
              android:name="it.mappe.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;
  </code></pre></li>
  <li><p>my main activity</p>
  
  <pre><code>public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  }   
  </code></pre></li>
  <li><p>my activity_main:</p>
  
  <pre><code>&lt;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"/&gt;
  </code></pre></li>
  <li><p>copy directory  <code>ANDROID_SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib</code> to root of your project</p></li>
  <li><p>add <code>/extras/android/compatibility/v4/android-support-v4.jar</code> as
  external jar</p></li>
  <li><p>add next line to the <code>YOUR_PROJECT/project.properties</code>
  <code>android.library.reference.1=google-play-services_lib</code></p></li>
  </ul>
  
  <p>When i run it on my samsung galaxy S (with google play services apk), it crashs and logcat shows this errors</p>
  
  <pre><code>E/AndroidRuntime(6435): FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{it.mappe/it.mappe.MainActivity}: 
  
  android.view.InflateException: Binary XML file line #2: Error inflating class fragment
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
      at android.app.ActivityThread.access$1500(ActivityThread.java:117)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:123)
      at android.app.ActivityThread.main(ActivityThread.java:3687)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:507)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
      at dalvik.system.NativeStart.main(Native Method)
   Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
      at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
      at android.app.Activity.setContentView(Activity.java:1657)
      at it.mappe.MainActivity.onCreate(MainActivity.java:12)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
      ... 11 more
   Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/it.mappe-2.apk]
      at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
      at android.view.LayoutInflater.createView(LayoutInflater.java:471)
      at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
      at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
      ... 19 more
  </code></pre>
  
  <p>some suggestions?</p>
  
  <p>EDIT</p>
  
  <p>here my main.xml:</p>
  
  <pre><code>&lt;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"/&gt;
  </code></pre>