270 likes | 387 Views
Google map v2. https:// code.google.com/apis/console. Manifest.xml > Manifest. Manifest.xml > Application. Name : com.google.ancdroid.maps.v2.API_KEY. Manifest.xml > Permissions. Name : com.gmac.simple.map2.permission.MAPS_RECEIVE Label : signature. 선택 : android.permission.INTERNET
E N D
Manifest.xml > Application Name : com.google.ancdroid.maps.v2.API_KEY
Manifest.xml > Permissions Name : com.gmac.simple.map2.permission.MAPS_RECEIVE Label : signature
선택 : android.permission.INTERNET android.permission.WRITE_EXTERNAL_STORAGE android.permission.ACCESS_NETWORK_STATE android.permission.ACCESS_FINE_LOCATION android.permission.ACCESS_COARSE_LOCATION 타이핑 : com.google.android.providers.gsf.permission.READ_GSERVICES
Manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gmac.simple.map2" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <uses-feature android:glEsVersion="0x00020000" android:required="true"/> <permission android:label="signature" android:name="com.gmac.simple.map2.permission.MAPS_RECEIVE"></permission> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value=“your key value"/> <activity android:name="com.gmac.simple.map2.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
Layout > activity_main.xml <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fragment" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent"/>
MainActivity.java package com.gmac.simple.map2; // 자기 패키지명 import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.maps.GoogleMap; public class MainActivity extends FragmentActivity { GoogleMapmGoogleMap; // 구글맵 객체 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }