Note that there are some explanatory texts on larger screens.

plurals
  1. POsend value location continues after 10 minute
    primarykey
    data
    text
    <p>i want to send my location into my database.. i have code to get location (longitude and latitude) like this</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LocationManager locationManager; String context = Context.LOCATION_SERVICE; locationManager = (LocationManager)getSystemService(context); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); criteria.setPowerRequirement(Criteria.POWER_LOW); String provider = locationManager.getBestProvider(criteria, true); //Location location = locationManager.getLastKnownLocation(provider); updateWithNewLocation(null); locationManager.requestLocationUpdates(provider, 2000, 10, locationListener); } private final LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) { updateWithNewLocation(location); } public void onProviderDisabled(String provider){ updateWithNewLocation(null); } public void onProviderEnabled(String provider){ } public void onStatusChanged(String provider, int status, Bundle extras){ } }; private void updateWithNewLocation(Location location) { //EditText etlat=(EditText)findViewById(R.id.lat); //EditText etlong=(EditText)findViewById(R.id.lng); if (location != null) { double lat = location.getLatitude(); System.out.println(lat); double lng = location.getLongitude(); System.out.println(lng); double alt = location.getAltitude(); System.out.println(alt); etlat.setText(String.valueOf(lat)); etlng.setText(String.valueOf(lng)); etalt.setText(String.valueOf(alt)); } } </code></pre> <p>and then i want to save my location continues into database with interval 10 minute..<br> how can i do this??thank you :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload