0

maybe this questions has been asked there millions of times, but nothing help me.

java activity

package com.williamroma.example;

import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class MainActivity extends FragmentActivity {
    @Override
    protected void onCreate(Bundle arg0) {
        // TODO Auto-generated method stub
        super.onCreate(arg0);
        setContentView(R.layout.main);
        GooglePlayServicesUtil
                .isGooglePlayServicesAvailable(getApplicationContext());
        GoogleMap map = ((SupportMapFragment)  getSupportFragmentManager().findFragmentById(R.id.map))
                   .getMap();
    }
}

java mainfest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.williamroma.example"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="8" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <permission
        android:name="com.williamroma.example.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.williamroma.example.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <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/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyCyk2MVC5Fyl7HIB3iHlPgyRqvOF-VXYJw" />
    </application>

</manifest>

project

enter image description here

emulator 2.2

enter image description here

where is the wrong please? i have installed google play service from sdk and import it , and then add it from project->property->android->add .

i have the key for google-map android v2 successfully

please help

user2208349
  • 7,429
  • 5
  • 26
  • 35
  • 1
    It's very self-explanatory. You need Google Play Services to make it work. Google Play Services is an application you can download from Google Play. However, the emulator does not have access to Google Play, so you can't test this on an emulator. Get a physical device to debug Map-based apps. – Charlie-Blake Apr 01 '13 at 14:34
  • @ElefantPhace i know it is duplicated but nothing help me – user2208349 Apr 01 '13 at 14:34
  • 1
    @santirivera92 i test it in my phone and the same resutls , i can't sign up for google play cos i am from syria and google products are not allowed, i am sure that i can run it in my emulator but how ? :( – user2208349 Apr 01 '13 at 14:35
  • you can't run it in emulator. And you'll need the play services before you can run it on your phone too – ElefantPhace Apr 01 '13 at 14:37
  • @ElefantPhace so no wrongs in my code ? just add the goole play in my phone and it will work? i wonder why not in emulator , i spend 2 hours downloading the google play service from sdk – user2208349 Apr 01 '13 at 14:39
  • @santirivera92 my goverment is saving my from terrorist – user2208349 Apr 01 '13 at 14:39
  • @user2208349 terrorist? or terriers? I don't really think either have anything to do with Google though – ElefantPhace Apr 01 '13 at 14:40

0 Answers0