how to create Google map in android -
i new in android.i need create google map.i try create google map in emulator drive
android-sdk-windows\add-ons\addon-google_apis-google-16\samples\mapsdemo
1) added map,effect , usbs jar file in libs folder.
2) added permission
<uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.internet" />
but come error code
error:
04-25 18:00:00.857: e/androidruntime(2339): fatal exception: main 04-25 18:00:00.857: e/androidruntime(2339): java.lang.runtimeexception: unable start activity componentinfo{com.example.androidmap/com.example.androidmap.mainactivity}: android.content.activitynotfoundexception: unable find explicit activity class {com.example.androidmap/com.example.androidmap.mapsdemo}; have declared activity in androidmanifest.xml? 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activitythread.performlaunchactivity(activitythread.java:2059) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2084) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activitythread.access$600(activitythread.java:130) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activitythread$h.handlemessage(activitythread.java:1195) 04-25 18:00:00.857: e/androidruntime(2339): @ android.os.handler.dispatchmessage(handler.java:99) 04-25 18:00:00.857: e/androidruntime(2339): @ android.os.looper.loop(looper.java:137) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activitythread.main(activitythread.java:4745) 04-25 18:00:00.857: e/androidruntime(2339): @ java.lang.reflect.method.invokenative(native method) 04-25 18:00:00.857: e/androidruntime(2339): @ java.lang.reflect.method.invoke(method.java:511) 04-25 18:00:00.857: e/androidruntime(2339): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) 04-25 18:00:00.857: e/androidruntime(2339): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) 04-25 18:00:00.857: e/androidruntime(2339): @ dalvik.system.nativestart.main(native method) 04-25 18:00:00.857: e/androidruntime(2339): caused by: android.content.activitynotfoundexception: unable find explicit activity class {com.example.androidmap/com.example.androidmap.mapsdemo}; have declared activity in androidmanifest.xml? 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.instrumentation.checkstartactivityresult(instrumentation.java:1541) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.instrumentation.execstartactivity(instrumentation.java:1416) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activity.startactivityforresult(activity.java:3351) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activity.startactivityforresult(activity.java:3312) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activity.startactivity(activity.java:3522) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activity.startactivity(activity.java:3490) 04-25 18:00:00.857: e/androidruntime(2339): @ com.example.androidmap.mainactivity.oncreate(mainactivity.java:14) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activity.performcreate(activity.java:5008) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1079) 04-25 18:00:00.857: e/androidruntime(2339): @ android.app.activitythread.performlaunchactivity(activitythread.java:2023) 04-25 18:00:00.857: e/androidruntime(2339): ... 11 more
edit:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.androidmap" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.internet" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <uses-library android:name="com.google.android.maps" /> <activity android:name="com.example.androidmap.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> <activity android:name="com.example.android.apis.mapsdemo" android:label="mapsdemo"/> <activity android:name="com.example.android.apis.view.mapviewdemo" android:label="mapview"/> <activity android:name="com.example.android.apis.view.mapviewcompassdemo" android:label="mapview , compass"/> </application> </manifest>
please me.
you need extend class mapactivity , make sure have declare in menifest.xml file or follow link google maps