Hy guys!
I am Android novice and I am trying to build a simple app that shows the map . I have an issue witch i cannot solve I checked and double everything . I have the Google api 10 installed and I am using the emulator for it .
My code files are :
AndroidManifest
The Layout main.xml
And the Activity class
The app shuts only shows the title bar and crashes in a couple of seconds .
In the Log I get :
unable to instantiate activity ComponentInfo{local.....} ClassNotFoundException in local.... in loader dalvik.system...
Thanks for you're help !
I am Android novice and I am trying to build a simple app that shows the map . I have an issue witch i cannot solve I checked and double everything . I have the Google api 10 installed and I am using the emulator for it .
My code files are :
AndroidManifest
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="local.Hello.Android"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloAndroidActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The Layout main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapView" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:enabled="true"
android:clickable="true" android:apiKey="0C-yhfAeNcxQceQI6CFZVWlfmp1lWD7jHn-H7oQ" android:layout_alignParentRight="true">
</com.google.android.maps.MapView>
</RelativeLayout>
</manifest>
And the Activity class
Code:
package local.Hello.Android;
import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.*;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;;
public class HelloAndroidActivity extends MapActivity
{
//user information
private String fullName = ""; //change it to "" after test //user full name
private long user_id = 0; //change it to 0 after test //user id
MapView map;
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
{
//create
super.onCreate(savedInstanceState);
Log.w("start","oncreate start");
setContentView(R.layout.main);
Log.w("start","Homeview");
map = (MapView) findViewById(R.id.mapView);
//map.setBuiltInZoomControls(true);
map.setClickable(true);
}
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
The app shuts only shows the title bar and crashes in a couple of seconds .
In the Log I get :
unable to instantiate activity ComponentInfo{local.....} ClassNotFoundException in local.... in loader dalvik.system...
Thanks for you're help !