Code example for Location

Methods: getLatitudegetLongitudetoString

0
    } 
 
    private class location_listener implements LocationListener {
        public void onLocationChanged (Location loc) {
            if (null != loc) {
                Log.d (TAG, "THE LOCATION HAS JUST CHANGED TO: " + loc.toString ());
                String lat = Double.toString (loc.getLatitude ());
                String lon = Double.toString (loc.getLongitude ());
                int ret;
 
                /* let the location manager get a 5 updates before using one */ 
                if (0 != counter  && counter --> 0) {
                    return; 
                } 
 
                sdb.open();
                ret = sdb.update_gpsless_entries (lon, lat);
                sdb.close();
 
                if (0 != ret) {
                    pref.edit ().putBoolean ("light_loc", false).commit ();