I tried to make a google map where using location ,i get my location’s lon,lat.
Here is my code
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Location myLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
String uri = "http://maps.google.com/maps?saddr=" + (myLocation.getLatitude())+","+(myLocation.getLongitude())+"&daddr="+destLat+","+destLon;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);
It runs but nothing is happen. just show my location.Can any one tell me where is the error in declaration??Please
Here is a complete source code at https://github.com/frogermcs/RoutePathExample for how to draw path between two geolocation. I use this code without any trouble at all. You should check it