Note that there are some explanatory texts on larger screens.

plurals
  1. POinternet connection paused after android phone lock
    primarykey
    data
    text
    <p>I am building application which can get location using <code>NETWORK_PROVIDER</code> periodically in background without using <code>GPS_PROVIDER</code>. I am using <code>ALARM_SERVICE</code> and <code>WakeLock</code>(<code>PARTIAL_WAKE_LOCK</code>). but the problem which i am facing is that internet connection gets disconnected once the screen goes off. when I unlocks the phone I starts receiving the location, but when the screen goes off I am not getting the locations.</p> <p>Is it because:</p> <ol> <li>Internet connection gets paused once the screen goes off and also when I unlocks the screen I get the USSD code messages of Data Usage, so does it means my internet connection goes off once the screen goes off?</li> <li>Even though the internet connection is on but location doesn't gets updated in background as the screen is in off state.</li> </ol> <p>I am using GpsTracker class to get location from <a href="http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/" rel="nofollow">here</a> and using AlarmManager get location periodically. also in <code>LatLongBroadcastReceiver</code> class i am fetching a location.</p> <pre><code>Intent intent = new Intent(GPSlatlongActivity.this, LatLongBroadcastReceiver.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); pendingIntent = PendingIntent.getBroadcast( GPSlatlongActivity.this.getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), (AlarmManager.INTERVAL_FIFTEEN_MINUTES / 15), pendingIntent); </code></pre>
    singulars
    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