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/
3. Types of Intent
Intent
Explicit
Implicit
• Explicit
• Implicit
• An application can define the
target component directly in the
intent
• Ask the Android system to
evaluate registered components
based on the intent data implicit
intents
www.crescosolution.com
4. Explicit Intent
The component which should be
called by the Android system, by
using the Java class as identifier ,
The following shows how to create
an explicit intents and send it to the
Android system
i.e :- Intent i = new Intent (This,
SecondActivity.class);
Explicit
Intent
Typically used within an
application as the classes
in an application are
controlled by the
application developer
www.crescosolution.com
startActivity(i);
5. Implicit Intent
Implicit intents specify
the action which should
be performed and
optionally data which
provides data for the
action , For example
the following tells the
Android system to view
a webpage. All installed
web browsers should
be registered to the
corresponding intent
data
www.crescosolution.com
6. Data transfer between activities using INTENT
An intent contains the action and optionally
additional data
The component which creates the Intent
can add data to it via the overloaded
putExtra() method
Extras are key/value pairs; the key is
always a String
This Intent object can be retrieved via the
getIntent() method
The component which receives the intent
can use the getIntent().getExtras() method
call to get the extra data
www.crescosolution.com
i.e :- Bundle extras =
getIntent().getExtras();
if (extras == null) {
return;}// Get
data via the key
String value1 =
extras.getString(Intent.EXTRA_TEXT
);
if (value1 != null) { // do
something with the data
}
7. Android MANIFEST
Every application must have an AndroidManifest.xml file (with precisely
that name) in its root directory
Manifest file for an android application is a resource file which
contains all the details needed by the android system about the
application
It is a key file that works as a bridge between the android
developer and the android platform
It helps the developer to pass on functionality and requirements of
our application to Android
This is an xml file which must be named as AndroidManifest.xml and
placed at application root.
www.crescosolution.com
8. Elements for application components
The set of attributes based on user interface
Specifies target activities
The operation provided by any library or API, running
in background that is not visible
That makes to receive message broadcasted by the
same application or by outside entity
Provides some structure to access application data
It specifies set of library files need to run the
application
www.crescosolution.com
9. Structure of Android Manifest.xml
<manifest>
<Elements for Application properties should come here refer above for list>
<application>
<Elements for application components should come here refer above for list>
</application>
</manifest>
www.crescosolution.com