Questions about using the mapactivity class in Android

Source: Internet
Author: User

I recently learned how to be a small Google-Map-API app ......

The first is about the reference location of <uses-Library/>, which is not mentioned in the book. As soon as the result program runs, the has stopped unexpectedly error occurs. At first, I thought there was a problem with the key provided by the API, so I applied for a new one, but the problem still exists. So I found a crazy search on the Internet, which should be like this:   <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: The <uses-Library/> label can be added only in the <application/> label. If the tag is not correctly placed, it will not be correctly loaded as a third-party library. After the change, the system continues to run. The error still persists. It is has stopped unexpectedly. After several experiments, the problem is finally locked to the mapactivity class, because everything works normally when inheriting the activity class as usual, GPS can also be simulated, but if mapactivity is inherited, the above error will occur. I suddenly remembered whether the library problem was encountered during the build process. Then I changed the Project Build target option of the android option in the attribute from android1.5 to the Google APIS type. At this time, add the library as a third-party library to Java
The map. Jar library of build path is deleted, because after this is selected, the MAR. Jar library is automatically included in Google APIs. Now, we can see that I 've been tossing Google map for several hours ...... Burn incense ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.