This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
android:structure_of_an_android_app [2017/06/05 09:33] ko4bb |
android:structure_of_an_android_app [2017/06/18 11:19] ko4bb |
||
---|---|---|---|
Line 11: | Line 11: | ||
An Android app is composed of one or more Activities and optionally one or more Service modules, Class modules and Libraries. | An Android app is composed of one or more Activities and optionally one or more Service modules, Class modules and Libraries. | ||
- | An Activity is a block of code (a module) that is associated with a particular Graphical User Interface (a Layout in Android parlance,) composed of buttons, labels, pictures, text boxes and other graphical elements. | + | An Activity is a block of code (a module) that is associated with a particular screen layout (a Layout in Android parlance,) composed of buttons, labels, pictures, text boxes and other graphical elements. |
Since in Android only one Activity can be active at any one time (unlike Windows or Linux where you can have multiple running windows sharing the screen), any Activity that is not currently visible is suspended and can even be unloaded from memory by the OS. Note that in Android 7.0, multiple apps may run in multi-window mode but only one is active at a time, the others are paused. | Since in Android only one Activity can be active at any one time (unlike Windows or Linux where you can have multiple running windows sharing the screen), any Activity that is not currently visible is suspended and can even be unloaded from memory by the OS. Note that in Android 7.0, multiple apps may run in multi-window mode but only one is active at a time, the others are paused. | ||
- | A Service module does not have a GUI component. A Service can continue running in the background even if the app is not visible. | + | A Service module does not have a GUI component. A Service continues running in the background even if the app is not visible, so a Service is the only way to have code running while the app has no visible activity. However, a Service cannot have any visible element (except for Toast messages). |
Activities may communicate with a Service module, Class modules and Libraries (both ways) via shared global variables and subroutines. | Activities may communicate with a Service module, Class modules and Libraries (both ways) via shared global variables and subroutines. |