Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Depending on the application you are writing, some of these may apply to you:</p> <ul> <li>Don't use excessive network calls. Try to maintain a cache of data that will change infrequently, and only run a full refresh after say 10 seconds of their last refresh (stops them spamming the server, gives a faster response)</li> <li>Cancel any async tasks running if they are not needed (for example, no need downloading the rest of that picture/website if the user navigates out of the activity that uses it)</li> <li>Make use of OnPause/OnResume to pause/resume games</li> <li>Make use of the OnStop/OnStart methods to save program state and reload it when necessary. Note that in this state, an app is 'no longer visible' and may be killed if other apps require the memory, meaning the next time it is run, you'll either go into onRestart() or onCreate()</li> <li>Avoid setting the screen to remain on (<code>setKeepScreenOn(boolean)</code> or <code>android:keepScreenOn</code>) . video should probably be one of the only instances where you would utilise this functionality</li> <li>Avoid building widgets that update frequently and <a href="https://stackoverflow.com/questions/2416782/android-how-update-widget-often-but-only-when-it-is-visible" title="only update it when it&#39;s visible">only update it when it's visible</a></li> </ul> <p>There is a nice flowchart showing the different methods that get called for pausing/resuming on the android developer site:</p> <p><a href="http://developer.android.com/reference/android/app/Activity.html" rel="nofollow noreferrer">http://developer.android.com/reference/android/app/Activity.html</a></p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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