I am learning Android recently and want to make a small application of google-map-api, but I don’t know how hard it is...
The first thing is about the reference position of
Java code
<application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <uses-library android:name="com.google.android.maps" /> </application>
Note that the
After changing this, I continued to run, but the error still occurred, and it still stopped unexpectedly. After several experiments, I finally locked the problem on the MapActivity class, because when I inherited the Activity class as usual, everything was normal, and the GPS also It can be simulated, but if it inherits MapActivity, the above error will occur. Suddenly I remembered whether there was a problem with the library during the build process, and then changed the Project build target option of the Android option in the properties from Android1.5 to Google APIs type. At this time, I had to use it as a third-party library according to the book Delete the map.jar library added to the JAVA build path, because after selecting this, the mar.jar library is automatically included in Google APIs.
At this point, if you run it again, you can see the google map that I have been working on for several hours...
Burn incense...