I want to pass the place name in maps which will find the place automatically. i had done for the map design in the following way.
Using java Syntax Highlighting
- package org.me.mapping;
- //import android.graphics.Point;
- import com.google.android.maps.Point;
- import android.os.Bundle;
- import android.view.KeyEvent;
- import com.google.android.maps.MapActivity;
- import com.google.android.maps.MapController;
- import com.google.android.maps.MapView;
- public class Mapping extends MapActivity {
- Point p;
- Point p1;
- // Address add[];
- private MapView myMapView;
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- myMapView = new MapView(this);
- p = new Point((int) (40.689213 * 1000000),
- (int) (91.044558 * 1000000));
- //Point p1 = new Point((int) (34.4164*1000000), (int) (70.025078 * 1000000 ));
- MapController mc = myMapView.getController();
- mc.animateTo(p);
- mc.zoomTo(5);
- /* setContentView(R.layout.main);
- EditText locationField = (EditText) findViewById(R.id.location);
- locationField.setSelection(0, locationField.getText().length());
- */
- setContentView(myMapView);
- // myMapView.toggleSatellite();
- }
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_I) {
- myMapView.getController().zoomTo(myMapView.getZoomLevel() + 1);
- return true;
- } else if (keyCode == KeyEvent.KEYCODE_O) {
- myMapView.getController().zoomTo(myMapView.getZoomLevel() - 1);
- return true;
- } else
- if (keyCode == KeyEvent.KEYCODE_S) {
- myMapView.toggleSatellite();
- return true;
- } else if (keyCode == KeyEvent.KEYCODE_T) {
- myMapView.toggleTraffic();
- return true;
- }
- return false;
- }
- }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4
in this i want to give the place name which will the place name automatically.
Thanks,
Dolan.






