Android
Mobile App Development
11/12/2019 1
Image source: [Link]
- linux-based Operating System for mobile devices such as smart
phones and tablet computers
- offers a unified approach to application development
11/12/2019 2
Image source: [Link]
Why Android?
11/12/2019 3
Image source [Link]
Android Versions
11/12/2019 4
Image source: [Link]
11/12/2019 5
Image source: [Link]
API Levels
11/12/2019 6
Image source: [Link]
Android Architecture
Runs on top of Linux.
Dalvik Virtual Machine (DVM) optimized for mobile devices.
Integrated browser based on the WebKit engine.
Optimized graphics with OpenGL ES.
SQLite database for structured data storage.
11/12/2019 7
Android Architecture
11/12/2019 8
Image source: [Link]
Application Fundamentals
Applications are written in Java programming language.
Compiled into an Android package file (.apk).
Each application runs in its own sandbox and Linux process.
Applications consist of components, a manifest file and resources.
Components
Activities
Services
Content providers
Broadcast receivers
11/12/2019 9
Activities
An activity represents a single screen with a user interface.
Most applications contain multiple activities.
When a new activity starts, it is pushed onto the back stage.
User interface can be built with XML or in Java.
Monitor lifespan through callback methods like onCreate, onStart(), onPause, etc.
11/12/2019 10
Services
Services perform long running operations in the background.
Does not contain a user interface.
Useful for things like network operations, playing music, etc.
Runs independently of the components that created it.
Can be bound to by other application components, if allowed.
11/12/2019 11
Content Providers
Used to store and retrieve data and make it accessible to all applications.
Are the only way to share data across applications.
Exposes a public URI that uniquely identifies its data set.
Data is exposed as a simple table on a database model.
Android contains many providers for things like contacts, media, etc.
11/12/2019 12
Broadcast Receivers
A component that responds to system-wide broadcast announcements.
Examples includes when the screen turns off, the battery is low, etc.
Applications can also initiate their own broadcasts.
Broadcast receivers contain no user interface.
They can create bar notifications to alert the user.
11/12/2019 13
Android Manifest File
Applications must have a [Link] file in its root directory.
Presents information about the application to the android system.
Describes the components used in the application.
Declares permissions required to run the application.
Declares the minimum Android API level that the application requires.
11/12/2019 14
Lets build our first application…
11/12/2019 15