avd를 구글 api용으로 다시 만들어준다.




main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <com.google.android.maps.MapView
        android:id="@+id/map"
        android:clickable="true"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="여기에다가 구글키를 복사해둠" />
			
</LinearLayout>


manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.googlemap"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".GoogleMapActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.google.android.maps"/>
    </application>

</manifest>


GoogleMapActivity.java
package com.googlemap;

import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class GoogleMapActivity extends MapActivity {
	
	MapView map;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        map=(MapView) findViewById(R.id.map);
	}

	@Override
	protected boolean isRouteDisplayed() {
		return false;
	}
}



'Android > 2012.04월 강좌' 카테고리의 다른 글

9일차 복습  (0) 2012.05.08
8일차 Google Map 2  (0) 2012.05.07
8일차 Google Key 인증  (0) 2012.05.07
8일차 Service 2(음악 파일 재생)  (0) 2012.05.07
8일차 Service (음악 파일 재생)  (0) 2012.05.07

+ Recent posts