10 Days Android Workshop at L J Institute of engineering and technology delivered by Cresco Solution visit: http://www.crescosolution.com/android-workshop-at-l-j-institute-of-engineering-and-technology-ahmedabad/
Advance Android application development workshop day 3
1.
2. Application
Fundamentals
• Each application runs it’s own
process
• Each process has its own separate
virtual machine
• Each application is assigned a
unique linux user -ID
www.crescosolution.com
4. Activity
Basic
component
of most
applications
Most
applications
have more
than one
activities
that all start
each other
as needed
Each activity
implements
as a
subclass of
base Activity
class.
Each activity
is default
window
www.crescosolution.com
The content
of window is
view or
group of
views
Example of
views : text ,
buttons ,
scroll bars
,menu items
etc…
Activity
represents
presentation
layer in
android UI.
5. Intents
An Intent is exactly what it describes. It's an "intention" to do an action.
An Intent is a messaging object you can use to request an action from another
app component.
An Intent is basically a message to say you did or
want something to happen.
Although intents facilitate
communication between
components in several
ways.
www.crescosolution.com
6. Types of Intents
Explicit
intents
Implicit
intents
•Specify the component to start by name
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
•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
www.crescosolution.com
8. Elements of Android Manifest File
<manifest>
•root element of the AndroidManifest.xml file
•It includes the namespace declaration
•It has package attribute that describes the package name of the activity class
<application>
•contains several sub elements
•The commonly used attributes are of this element are icon, label, theme etc.
<activity>
<intent-filter>
<action>
<category>
•Each activity must be defined
•android:label represents a label for the activity, often displayed on the screen
•android:name represents a name for the activity class. It is required attribute
•describes the type of intent to which activity, service or broadcast receiver
•It adds an action for the intent-filter
•intent-filter must have one or more action elements
•It adds an category name to an intent-filter
www.crescosolution.com
9. Content Providers
Supplies data from one
application to others on
request
Such requests are handled
by the methods of the
ContentResolver class
www.crescosolution.com
A content provider can
use different ways to
store its data and the data
can be stored in a
database, in files, or even
over a network
10. Service
❏
❏
❏
❏
❏
❏
Does not have visual interface
Runs in background indefinitely
Examples:
Playing
Music
You can bind to a an existing service and
control its operation
Content provider and intents are short lived but
services are always running
Suppose even you exit from app ,the
background process
running.
www.crescosolution.com
11. Broadcast Receiver
Receive and
react to
broadcast
announcements
Extend the class
BroadcastReceiver
•Low battery, power
connected,
shutdown, time zone
changed, etc.
Examples:
A broadcast receiver is an
Android component which
allows you to register for
system or application events.
www.crescosolution.com