Code example for Location

Methods: getLatitudegetLongitude

0
   
  LocationListener onLocation=new LocationListener() {
    public void onLocationChanged(Location location) { 
      StringBuilder buf=new StringBuilder("javascript:whereami("); 
       
      buf.append(String.valueOf(location.getLatitude())); 
      buf.append(","); 
      buf.append(String.valueOf(location.getLongitude())); 
      buf.append(")"); 
       
      browser.loadUrl(buf.toString()); 
    } 
     
    public void onProviderDisabled(String provider) { 
      // required for interface, not used 
    } 
     
    public void onProviderEnabled(String provider) { 
      // required for interface, not used 
    }