Note that there are some explanatory texts on larger screens.

plurals
  1. POGPS unchange periodically
    text
    copied!<p>My Gps Code using android didnt change periodically despite i made changelocation method here is my code and i want to know why i doesn't change some times it keep same lat and long for long time say for distance 10 meters then change here is code </p> <pre><code>enter code here public class MyLocationListener implements LocationListener { @Override public void onLocationChanged(Location loc) { GeoPoint point = new GeoPoint((int) (loc.getLatitude() * 1E6), (int) (loc.getLongitude() * 1E6)); String Text = "My current location is: " + "Latitud =" + loc.getLatitude()+ "Longitud =" +loc.getLongitude() ; Toast.makeText(getApplicationContext(), Text, Toast.LENGTH_SHORT).show(); } } private Resources getResources() { // TODO Auto-generated method stub return null; } public void onProviderDisabled(String provider) { Toast.makeText(getApplicationContext(), "Gps Disabled", Toast.LENGTH_SHORT).show(); } public void onProviderEnabled(String provider) { Toast.makeText(getApplicationContext(), "Gps Enabled", Toast.LENGTH_SHORT).show(); } public void onStatusChanged(String provider, int status, Bundle extras) { } protected boolean isRouteDisplayed() { return false; } }/* End of Class MyLocationListener */ @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } </code></pre> <p>So what method i need also to add !! </p> <pre><code>enter code here &lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p></p> <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;activity android:name=".tryanabtry" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.HOME"/&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; </code></pre> <p> </p> <p>the request location update is here it is on the oncreate method </p> <pre><code>enter code here mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mlocListener); </code></pre>
 

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