android - sending location to google map with latitude and longitude -


this how getting current location. question is there way make latitude , longitude link user can click , there current position shown on googlemap . because sending link via text message android , when clicks on link google map install in mobile open or googlemap website open , location lang , lat shown on map. don't know how achieve ?

   public void onlocationchanged(location location) {              mlocationview.settext("location received: "+ location.getlatitude() + location.getlongitude()); 

for simple url constructed can add sms message, this:

string link = "http://maps.google.com/maps?q=loc:" + string.format("%f,%f", location.getlatitude() , location.getlongitude() ); 

for example, code:

double lat = 37.77657; double lon = -122.417506; string link = "http://maps.google.com/maps?q=loc:" + string.format("%f,%f", lat, lon); 

constructs link this:

http://maps.google.com/maps?q=loc:37.776570,-122.417506 

for more info, see this question.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -