[Java for Android App Development] ahmadssb:
thank you for the link, but I still getting the same error in my phone (Galaxy S 2, ROM CyanogenMod 10.1 )

also using the emulator with 2 AVD for (4.2.2) and (4.2.2 with Google API)

still not working

I start to think (and maybe it is :eek:) that the problem is not from the code the problem is from my phone or the setting in my PC or Eclipse :confused:

while any other application is working fine with me except that using google apis key (actually I didn't try any thing that needs api key and this is my first time using it)

BTW this is the result from the tutorial from the link that you gave to me

====================================================

Log:

——-

04-26 01:28:57.494: D/dalvikvm(5121): Late-enabling CheckJNI
04-26 01:28:57.629: E/Trace(5121): error opening trace file: No such file or directory (2)
04-26 01:28:57.659: D/AndroidRuntime(5121): Shutting down VM
04-26 01:28:57.659: W/dalvikvm(5121): threadid=1: thread exiting with uncaught exception (group=0x41ff7930)
04-26 01:28:57.679: E/AndroidRuntime(5121): FATAL EXCEPTION: main
04-26 01:28:57.679: E/AndroidRuntime(5121): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ahmadssb.locationgooglemapv2demo/in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity}: java.lang.ClassNotFoundException: Didn’t find class “in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity” on path: /data/app/com.ahmadssb.locationgooglemapv2demo-1.apk
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2223)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.ActivityThread.access$600(ActivityThread.java:153)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.os.Looper.loop(Looper.java:137)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.ActivityThread.main(ActivityThread.java:5226)
04-26 01:28:57.679: E/AndroidRuntime(5121): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 01:28:57.679: E/AndroidRuntime(5121): at java.lang.reflect.Method.invoke(Method.java:511)
04-26 01:28:57.679: E/AndroidRuntime(5121): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
04-26 01:28:57.679: E/AndroidRuntime(5121): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
04-26 01:28:57.679: E/AndroidRuntime(5121): at dalvik.system.NativeStart.main(Native Method)
04-26 01:28:57.679: E/AndroidRuntime(5121): Caused by: java.lang.ClassNotFoundException: Didn’t find class “in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity” on path: /data/app/com.ahmadssb.locationgooglemapv2demo-1.apk
04-26 01:28:57.679: E/AndroidRuntime(5121): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
04-26 01:28:57.679: E/AndroidRuntime(5121): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
04-26 01:28:57.679: E/AndroidRuntime(5121): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
04-26 01:28:57.679: E/AndroidRuntime(5121): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2214)
04-26 01:28:57.679: E/AndroidRuntime(5121): … 11 more

——

AndroidManifest.xml

——-

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ahmadssb.locationgooglemapv2demo"
android:versionCode="1"
android:versionName="1.0" >

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

<permission
android:name="com.ahmadssb.locationgooglemapv2demo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>

<uses-permission android:name="com.ahmadssb.locationgooglemapv2demo.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"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="in.wptrafficanalyzer.locationgooglemapv2demo.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="************MY API KEY***********"/>

</application>
</manifest>

——-

MainActivity.java

———-

package com.ahmadssb.locationgooglemapv2demo;

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

public class MainActivity extends FragmentActivity {
[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
[MENTION=439709]override[/MENTION]
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}

——

activity_main.xml

———-

<

RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<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"/>
</RelativeLayout>

———–