android 使用Google地图步骤要点
16lz
2021-01-26
使用Google地图其中有几个必要的步骤
1.新建的项目必须使用Google的map avd。
2.在AndroidManifest.xml
a 在<application>标签对内使用<uses-library android:name="com.google.android.maps" />否则程序会报错,即找不到我们使用mapActivity的那个类。我就在这里给晕了。一直以为自己的代码有问题。
b 因为要访问网络,所以要给授权<uses-permission android:name="android.permission.INTERNET" />
3在布局文件中要加上你从google申请的密钥,相信很多人都会了。呵呵
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="******"
/>
更多相关文章
- Android(安卓)中文 API 文档 (45) —— AbsoluteLayout.LayoutPara
- 揭秘uc浏览器三
- Android的ViewAnimator及其子类ViewSwitcher-android学习之旅(三
- 1.2android——UI界面之ScrollView实现上下文滚动
- android fragment学习4-底部布局扩展TabLayout
- Android(安卓)EditText设置Filter以后,xml布局文件中maxLength不
- Android开发:界面布局的基本使用
- Android(安卓)studio APP开发 控制UI布局的方式,用代码书写UI界面
- android软键盘以及输入法影响界面布局的问题