![]() | Chapter 8 - MyMap Example |
|
31 Jan 2011, 18:39
Jerry Houston (5 posts) |
Although I’ve added a righteous tag to the element of AndroidManifest.xml, ...that doesn’t seem to be quite enough to make the library available to my application. In the import statements in MyMap.java: import com.google.android.maps.MapActivity; the “com.google” parts of the paths are underlined red, with the error message saying that “the import google.com cannot be resolved.” Of course, that cascades into a LOT of compiler errors. I’d know exactly what to do about it in a C# application, but I’m new to both Java and Android. Obviously, I’ve neglected something, but I’m not sure what. What do I need to do in order to make the library available to the application? Thanks for a clue! |
|
31 Jan 2011, 22:14
Jerry Houston (5 posts) |
Obviously, my original message contained some text that didn’t make it through the parsing. What I originally said, and tried to illustrate with a bit of text pasted from it, was that I’d included the required “uses-library” tag in the “AndroidManifest.xml” file. |
|
01 Feb 2011, 19:00
Ed Burnette (1316 posts) |
When you create a project that uses the Google Maps API, you have to specify a Google-specific Build Target, for example “Google APIs (Platform: 2.3.1)”. You can change it later by right clicking on the project and selecting Properties > Android, select the new Build Target, and click OK. Everything should rebuild and get rid of the errors but if it doesn’t, run the Project > Clean command. |
|
01 Feb 2011, 21:59
Jerry Houston (5 posts) |
Thank you so much! I’d skipped over that Build Target setting without noticing that it was different than all the previous projects. Does there ever come a time when one may need both Android and Google libraries? |
|
02 Feb 2011, 15:55
Ed Burnette (1316 posts) |
Yes but the Google APIs target has both the Android and Google (com.google.*) libraries. It’s a superset of the Android APIs target. |
| You must be logged in to comment |

