[MyHosting.com]   [KO4BB Home Page]   [Manuals Home Page]   [KO4BB Wiki]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
android:structure_of_an_android_app [2017/06/18 11:20]
ko4bb
android:structure_of_an_android_app [2017/06/18 17:12]
ko4bb
Line 23: Line 23:
 This is where it becomes interesting,​ particularly if you have experience writing software for a desktop operating system like Windows or Linux. This is where it becomes interesting,​ particularly if you have experience writing software for a desktop operating system like Windows or Linux.
  
-The Android OS is designed to optimize battery and memory usage. Therefore Android can and will stop (and unload from RAM) any process that is not currently active (note that it is easy to keep a Service module ​active so that it is not unloaded, like a messaging app). You have no control of this, it may happen immediately or after a short delay depending on how busy the device is.+The Android OS is designed to optimize battery and memory usage. Therefore Android can and will stop (and unload from RAM) any process that is not currently active (note that a Service module ​will only be unloaded ​if the OS has already unloaded paused Activities and still needs more resources). You have no control of this, it may happen immediately or after a short delay depending on how busy the device is.
  
 The consequence of that is that if you have an app composed of an Activity and you momentarily leave your app to check your mail for instance; even if you do not close the app when you check your mail, the Activity will start anew when you return to it. The OS will not automatically save the state of your app for you. If you want to return where you were in the app, you have to save the state yourself. That sounds like a pain and it is, but it is better than having the OS guess what you want to keep and what not. There are reasons for this. The consequence of that is that if you have an app composed of an Activity and you momentarily leave your app to check your mail for instance; even if you do not close the app when you check your mail, the Activity will start anew when you return to it. The OS will not automatically save the state of your app for you. If you want to return where you were in the app, you have to save the state yourself. That sounds like a pain and it is, but it is better than having the OS guess what you want to keep and what not. There are reasons for this.
 
android/structure_of_an_android_app.txt ยท Last modified: 2017/06/18 17:12 by ko4bb
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Except as noted, this entire site Copyright © 2002-2017. KO4BB All rights reserved.