Monday, 23 July 2012

Google Map in android a simple example

   Google Map in android  a simple example



 main.xml




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

    <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="0vNjDM-9Hpz9W0naxngZObrxztXkFRH5LfyxboA"
        />

</RelativeLayout>

 Newmap1Activity.java



package a.b;

import com.google.android.maps.MapActivity;

import android.app.Activity;
import android.os.Bundle;

public class Newmap1Activity extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}


set the  internet permission and the library.









No comments:

Post a Comment