Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Building User
Interfaces
And ntents I
Prepared By : Chirag V. Rachchh
NJSMTI
For developing an Android application a
good knowledge of screen designing is vital.
Screen or layout is that part of our application
which the user will see and interact.
NJSMTI
Introduction to Intents
Creating Intents
Creating Broadcast Receivers
NJSMTI
Intents are the most unique and
important feature of Android development.
We can use intents for tasks such as
starting activities, services, etc.
NJSMTI
Intents are used as message passing
mechanisms that works both within our
application and between applications.
NJSMTI
As we have already discussed intents
are also used to broadcast events.
NJSMTI
action tag
uses the android:name attribute to specify
the name of the action being serviced. Each
Intent-filter must have at least one action
tag.
Category
uses the android:name attribute to specify
under which circumstances the action
should be serviced.
Each intent filter tag can include multiple
category tags. Following are the standard
values for this tag
ALTERNATIVE
SELECTED ALTERNATIVE
BROWSABLE
DEFAULT
HOME
LAUNCHER
data tag
Used to specify the data type on which the
component can act on.
The possible values for data tag
android:host
android:mimetype
android:path
android:port
android:scheme
Intent intent=getIntent();
String action=intent.getAction();
Uri data=intent.getData();
Intent intent=getIntent();
startNextMatchingActivity(intent);
Broadcast Receiver
NJSMTI
Update content
Launch services
Update Activity UI
Notify the user
onResume()
onPause()
ACTION_BOOT_COMPLETED
ACTION_CAMERA_BUTTON
ACTION_DATE_CHANGED
ACTION_MEDIA_EJECT
ACTION_NEW_OUTGOING_CALL
ACTION_SCREEN_OFF
ACTION_TIMEZONE_CHANGED
Intent.ACTION_BATTERY_CHANGED
android.net.conn.CONNECTIVITY_CHANGE
android.intent.action.ACTION_DOCK_EVENT
BROADCAST_STICKY