3. Android Architecture
Run on top of Linux.
Dalvik Virtual Machine optimized for mobile devices.
Integrated browser based on WebKit engine.
Optimized graphics with OpenGL ES.
SQLite database for structured data storage.
4. Application Fundamentals
Applications are written in the Java programming language.
Compiled into Android package file (.apk).
Each application run in its own sandbox and Linus process.
Applications consist of components, a manifest file and resources.
Components:
Activities
Services
Content providers
Broadcast receivers
5. 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 stack.
User interface can be built with XML or in Java.
6. Services
Service perform long-running operations in the background.
Dose not contain a user interface.
Useful for things like network operations, playing music, etc.
Runs independently of the component that created it.
Can be bound to by other application components, if allowed.
7. 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 URL 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
8. Broadcast Receivers
A component that responds to system-wide broadcast
announcements.
Example include when the screen turns of, the battery is low, etc.
Applications can also initiate their own broadcasts.
Broadcast receivers contain no user interface.
They can creat status bar notifications to alert the user.
9. Android Manifest File
Application must have an AndroidManifest.xml file in its root directory
Presents information about the application to Android system.
Describes the components used in application.
Declares the permissions required to run the application.
Declares the minimum Android API level that application requires.
13. Android Manifest File
Application must have an AndroidManifest.xml file in its root directory
Presents information about the application to Android system.
Describes the components used in application.
Declares the permissions required to run the application.
Declares the minimum Android API level that application requires.
14. 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 stack.
User interface can be built with XML or in Java.
17. Intent
Intent is a messaging object you can use to request an action from
another app component. Although intents facilitate communication
between components in several ways
It’s a way to Activate component :
• To start an activity
• To start a service
• To deliver a broadcast:
There are two types of intents: Explicit Intent, Implicit Intent
18. Building an Intent
The primary information contained in an Intent is the following:
• Component name
• Action
• Data
• Category
intent can carry additional information:
• Extras
• Flags
19. Explicit Intent
Explicit intents specify the component to start by name (the fully-qualified
class name). You'll typically use an explicit intent to start a component in
your own app, because you know the class name of the activity or service
you want to start. For example, start a new activity in response to a user
action or start a service to download a file in the background.
22. Implicit Intent
Implicit intents do not name a specific component, but instead
declare a general action to perform, which allows a component
from another app to handle it. For example, if you want to show the
user a location on a map, you can use an implicit intent to request
that another capable app show a specified location on a map.