Android Google Maps开发笔记:【2】如何配置AndroidManifest.xml文件
2014-06-28 14:29
573 查看
1.在<application>元素中加入子标签
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="your_api_key"/>
其中your_api_key置换成自己申请的API Key。
2.<manifest> 中加入一些许可信息
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>
其中com.example.mapdemo换成自己的包名。
3.加入其它信息
许可设置:<uses-permission> 作为<manifest> 的子元素,需要加入下列一些:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
OpenGL ES V2特性支持:同样也是作为<manifest> 的子元素。
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
代码意义:
android.permission.INTERNET Used by the API to download map tiles from Google Maps servers.
android.permission.ACCESS_NETWORK_STATE Allows the API to check the connection status in order to determine whether data can be downloaded.
com.google.android.providers.gsf.permission.READ_GSERVICES Allows the API to access Google web-based services.
android.permission.WRITE_EXTERNAL_STORAGE Allows the API to cache map tile data in the device's external storage area.
The following permissions are recommended, but can be ignored if your application does not access the user's current location, either programmatically, or by enabling the My Location layer.
android.permission.ACCESS_COARSE_LOCATION Allows the API to use WiFi or mobile cell data (or both) to determine the device's location.
android.permission.ACCESS_FINE_LOCATION Allows the API to use the Global Positioning System (GPS) to determine the device's location to within a very small area.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="your_api_key"/>
其中your_api_key置换成自己申请的API Key。
2.<manifest> 中加入一些许可信息
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>
其中com.example.mapdemo换成自己的包名。
3.加入其它信息
许可设置:<uses-permission> 作为<manifest> 的子元素,需要加入下列一些:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
OpenGL ES V2特性支持:同样也是作为<manifest> 的子元素。
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
代码意义:
android.permission.INTERNET Used by the API to download map tiles from Google Maps servers.
android.permission.ACCESS_NETWORK_STATE Allows the API to check the connection status in order to determine whether data can be downloaded.
com.google.android.providers.gsf.permission.READ_GSERVICES Allows the API to access Google web-based services.
android.permission.WRITE_EXTERNAL_STORAGE Allows the API to cache map tile data in the device's external storage area.
The following permissions are recommended, but can be ignored if your application does not access the user's current location, either programmatically, or by enabling the My Location layer.
android.permission.ACCESS_COARSE_LOCATION Allows the API to use WiFi or mobile cell data (or both) to determine the device's location.
android.permission.ACCESS_FINE_LOCATION Allows the API to use the Global Positioning System (GPS) to determine the device's location to within a very small area.
相关文章推荐
- Android开发配置文件AndroidManifest.xml详解 (2)
- Android配置文件Manifest.xml如何被加载、解析的
- Android开发配置文件AndroidManifest.xml详解 (1)
- 安卓开发_浅谈主配置文件(AndroidManifest.xml)
- AndroidManifest.xml 文件配置学习笔记
- Android Google Maps开发笔记:【3】如何配置emulator正确运行GoogleMaps程序
- AndroidManifest.xml配置文件各个知识点详解
- AndroidManifest.xml配置文件详解
- Launcher2分析(一)---整体结构和配置文件AndroidManifest.xml
- Android新开一个activity需要配置文件AndroidManifest.xml
- Android系统开发 - 扩展Androidmanifest.xml文件中<application>标签的属性
- AndroidManifest.xml配置文件详解
- Android下使用TinyXml读取xml配置文件(Cocos2d-x游戏开发)
- android Manifest.xml全局配置文件中根标签中package属性及<original-package>标签注意点
- AndroidManifest.xml配置文件详解
- AndroidManifest.xml文件配置说明
- Android学习笔记-AndroidManifest.xml配置文件详解
- AndroidManifest.xml配置文件详解 .
- AndroidManifest.xml配置文件
- [无线] AndroidManifest.xml配置文件详解