Reference:
https://developers.google.com/maps/documentation/android-api/map#indoor_mapshttps://developer.android.com/guide/topics/location/index.html
Illustration:
按照“取得 Google map的 API key”一文,取得了 Google Map API key之後,之後在下列檔案新增紅字的部分,就可以在你的 app裡面顯示 Google map了1. AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="your_package_name" >
<permission android:name="your_package_name.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="your_package_name.permission.MAPS_RECEIVE"/>
<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 ACCESS_COARSE/FINE_LOCATION 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" />
<application
android:allowBackup="true"
...... >
<meta-data
android:name="com.google.android.gms.version"
android:value="6587000" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@string/google_maps_key" />
.......
</application>
<!--
如果使用OpenGL ES version 2來顯示
避免 Google Play Store 認為我們的 App 不支援 OpenGL ES version 2
-->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
</manifest>
2. res/values/google_maps_key.xml
<resources>......
<string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">
YOUR_KEY_HERE
</string>
</resources>
沒有留言:
張貼留言