0
学习文档 仅供参考
0
毕业设计(论文)外文资料翻译
外文出处 Mark
Android 2 Chapter 33
oid open source project, and undoubtedly there will be some devices that lack Google Maps due to licensing issues. For example, at the time of this writing, the Archos 5 Android tablet does not have Google Maps.
0
0
学习文档 仅供参考
By and large, the fact that Google Maps is in an add-on does not affect your day-to-day development. However, bear in mind the following:
You will need to create your project with a suitable target to ensure the Google Maps APIs will be available.
To test your Google Maps integration, you will also need an AVD that supports the Google Maps API.
The Bare Bones
Far and away the simplest way to get a map into your application is to create your own subclass of MapActivity. Like ListActivity, which wraps up some of the smarts behind having an activity dominated by a ListView, MapActivity handles some of the nuances of setting up an activity dominated by a MapView.
In your layout for the MapActivity subclass, you need to add an element named, at the time of this writing, . This is the "longhand" way to spell out the names of widget classes, by including the full package name along with the class name. This is necessary because MapView is not in the namespace. You can give the MapView widget whatever android:id attribute value you want, plus handle all the layout details to have it render properly alongside your other widgets.
However, you do need to have these two items:
android:apiKey, which in production will need to be a Google Maps API key
android:clickable="true", if you want users to be able to click and pan through your map
For example, from the Maps/NooYawk sample application, here is the main layout:
<?xml version="" encoding="utf-8"?>
<RelativeLayout xmlns:android=" :// /apk/res/android"
android:layout_width="fill_parent"
android毕业设计外文资料翻译 来自淘豆网m.daumloan.com转载请标明出处.