Map Android.Help Me

Tutorials that use the MapActivity. Many using GPS functionality.

Map Android.Help Me

Postby inter » Mon Jun 16, 2008 4:40 pm

Help me !!! I 'm familar with Android a little . So ,cany one show me how to implement map application such as Gmap ,..Anyone can give me some idea .

Thank you
inter
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Feb 21, 2008 10:13 am

Top

To display map is simple

Postby keraisureshv » Sat Jul 12, 2008 8:49 am

hi
In Android to develop Map copy this XML com on layout\main.xml

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent"
  10.  
  11.    >    
  12.  
  13.          <view class="com.google.android.maps.MapView"
  14.  
  15.          android:id="@+id/myMapView"
  16.  
  17.          android:layout_width="306px"
  18.  
  19.          android:layout_height="264px"
  20.  
  21.          android:layout_x="10px"
  22.  
  23.                   android:layout_y="57px"
  24.  
  25.          />
  26.  
  27.              
  28.  
  29. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


and in java file copy this code

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package info.tanguy;
  2.  
  3.  
  4.  
  5. import com.google.android.maps.MapActivity;
  6.  
  7. import com.google.android.maps.MapView;
  8.  
  9. import com.google.android.maps.OverlayController;
  10.  
  11. import com.google.googlenav.DrivingDirection;
  12.  
  13. import android.app.Activity;
  14.  
  15. import android.os.Bundle;
  16.  
  17.  
  18.  
  19. public class mapDisplay extends MapActivity {
  20.  
  21.         @Override
  22.  
  23.     public void onCreate(Bundle icicle) {
  24.  
  25.         super.onCreate(icicle);
  26.  
  27.         setContentView(R.layout.main);
  28.  
  29.  
  30.  
  31.         MapView mapViewFromXML = (MapView)this.findViewById(R.id.myMapView);
  32.  
  33.        
  34.  
  35.         /* Retrieve its OverlayController. */
  36.  
  37.         OverlayController myOC = mapViewFromXML.createOverlayController();
  38.  
  39.        
  40.  
  41.         /* Add a new instance of our fancy Overlay-Class to the MapView. */
  42.  
  43.        
  44.  
  45.     }
  46.  
  47. }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4

Thank you
Suresh
I Develop Android Location Based System.
User avatar
keraisureshv
Freshman
Freshman
 
Posts: 5
Joined: Wed Jun 25, 2008 9:00 pm
Location: Ahmedabad

Top

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests