Using maps from Google
I'm trying to develop an application using Google's maps and I can't get this application to work. I have done all what is described in the tutorial of the "MapView" sample code, including getting a map key associated to the MD5 signature of my "debug.keystore" file but the emulator def开发者_C百科initively says that the application has stopped unexpectedly.
This error message appears when I try to process the setContentView
line of code.
The only point where I am not sure of doing what must be done is about the signature of my application : as far as I have understood the signing process of an application, in debug mode, there is nothing to do. Is it correct?
I develop in Java using the Netbeans IDE.
Thanks for the time you will spend trying to help me.
First off, I'd recommend you very much to switch to Eclipse where the official Android plugin is available which will actually give you the LogCat (that's phone-side console) and you will always know what's wrong when something doesn't work. I'm not so sure that the plugin for NetBeans works equally well.
Secondly, regarding your crash, it has nothing to do with the API Key (if the key was wrong, you would see an empty map). Two things here from the top of my mind:
- the Android version you need is the "Google APIs", not vanilla "Android"
- you didn't mention that Map library in the Manifest
So make sure that the library used with your project is "Google APIs" (of desired version, I'd stick with 2.1 or 2.2) and that there's this line in the Manifest file
<application ...>
...
<uses-library android:name="com.google.android.maps" />
</application>
Other than that, would be awesome to see some stack trace to be 100% sure.
精彩评论