Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Lecture 2: Android Introduction
1. By : Eyad Almassri
Lecture 2: Android Introduction
2020
2. Design Goals*
• Enchant me
– Sleek and aesthetically pleasing design
• Simplify my life
– Make life easier
• Make me amazing
– Empower people to try new things and to
use apps in inventive new ways
* Taken from Android Web site for developers at
http://developer.android.com/design/get-
started/creative-vision.html2
3. Memory Management
• Handled by the Linux kernel: supported by several
software modifications
– Works successfully on limited main memory
and slower CPU devices
• Resources utilized only as needed
• Sleep-like state when dormant
• Open app remains resident in main memory
– Least recently used (LRU) algorithm for
tracking
– Low memory killer (LMK) frees memory when
memory becomes scarce
3
4. Processor Management
• Requires four key objects: manifest, activities, tasks,
and intents
• Manifest: file that holds essential information that the
system must have before it can run an application
– AndroidManifest.xml
• Activity: application component that defines the user
interface screen that the individual uses to interact
with the application
4
5. Processor Management
(cont’d.)
• Task: “sequence of activities a user
follows to accomplish a goal”
– Can involve one or many apps
– Service: task that runs in the background
• Intent: mechanism that one app uses
to signal to another app that its
cooperation is requested to accomplish
something
– Allows apps to call on one another as
needed to meet a user’s request5
6. Activity States
• Created state: transient state when the
activity has just begun
• Started state: software initialization
begins and the first screen can be
drawn
– Generally considered the main screen
• Resumed state (running state):
activities execute until they are
interrupted by another activity or a user
command6
7. Activity States (cont’d.)
• Paused state: a stop for an activity
that is interrupted and ready to go
into a “background” mode
• Stopped state: activities disappear
from the user’s view
– Subsequently, activity may be
terminated or it may be recalled
7
8. Activity States (cont’d.)
• Destroyed state: formal indication
that the activity is terminated
– Will be removed completely from
system memory
– Background activities closed properly to
prevent memory leaks
8
10. Activity States (cont’d.)
• Back stack: data structure
– When new app is loaded, replaced app is
moved onto the stack
– Loading and unloading uses last-in, first-
out (LIFO) scheme
– User navigates previously viewed apps
using the screen’s “back” button
10
13. Activity States (cont’d.)
• Smoothly running Android system
– App developers
• Must remain aware of the many ways in which
an app can be terminated and impact on
resource allocation
• Ensure each app ends gracefully when
terminated by user regardless of app’s state at
the time
13
14. Device Management
• Apps are designed to accommodate
numerous devices, often without user
help
• Screen requirements
– Design considerations: screen size, screen
density, orientation, and resolution
– Density-independent pixel (dp): equivalent
to one physical pixel on a 160 dpi screen
– Interface design using dp unit: system can
perform the necessary scaling for each
screen based on its size, resolution,
orientation, and density
14
17. Device Management (cont’d.)
• Battery management
– Android device’s battery usage
information: Settings tab
– Ways to improver battery availability
• Users choose to leave certain functions
turned off until they are actually needed, e.g.,
GPS, Bluetooth communications, background
file syncing, etc.
• Wi-Fi instead of telephony: saves power
17
19. File Management
•Linux-managed at the kernel level
•User ID: the part of the operating system
that is the user’s own protected mode and
that allows it to manage the files it creates
and executes
–Each application has its own
–Not shared: no other apps can read or alter
the app’s files
–Two apps with same User ID: data is shared
•Supplementary appsUnderstanding Operating
Systems, 7e
19
20. User Interface
• Touch screen
– Features icons that are manipulated by
the user
– User-selected apps that remain in place
when the user swipes the screen from
side-to-side
– “Soft buttons” along screen bottom:
allow the user to perform critical tasks,
e.g., go home, go back, or view open
tasks
20