Monday, June 14, 2010

noclassdefFounderror map view google maps android

Hi,
If you are facing the  NoClassDefFound Error while using Maps, it means you are not using the Google Api. I mean to say is you need to use Google API in Target in place of Android x.x (version). And also dont forget to include maps.jar. And three modification in xml files.
1. you need to include the Map Key in the main.xml (layout file).
2. you need to add in application attribute in Manifest file.
3. finally you need to give uses-permission to access internet. So add the following line.

2 comments:

jiby said...

can you plz help me in how to call aactivity from another package . other than the package from which we are calling?

Unknown said...

Hi jiby,
what you can do is give that class some activity name in the manifest file. And then you can call that activity from your class. The same way as we call pre-packaged applications from our application.For example :
Intent contacts = new Intent(); contacts.setAction(android.content.Intent.ACTION_VIEW); contacts.setData(People.CONTENT_URI);
startActivity(contacts);

it will display all contacts.