본문 바로가기

Development/Android

[Android] Google Map View V2

우선은 Google Service Library가 필요하다 설치방법은 여기에~!


1. Google Cloud Console에서 Google Maps Android API v2 기능을 ON 해줍니다.~!


2. AndroidManifest.xml파일에 아래의 내용을 추가~!


<application>


<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="API키값"/>


</application>


 <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"/>

<uses-feature android:glEsVersion="0x00020000" android:required="true"/>



3. View 삽입


<fragment android:id="@+id/map"

          style="@style/MatchParentLayout"

          android:name="com.google.android.gms.maps.MapFragment"/>