SlideShare a Scribd company logo
1 of 11
Download to read offline
Intent

Allow you to
interact with
components from
the own and other
applications

www.crescosolution.com
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
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);
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
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
}
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
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
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
Sample AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".HelloWorld" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter></activity></application> </manifest>
www.crescosolution.com
Advance Android application development workshop day 4

More Related Content

More from cresco

More from cresco (7)

Advance Android wokshop day7
Advance Android wokshop day7Advance Android wokshop day7
Advance Android wokshop day7
 
Advance Android application development workshop day 7
Advance Android application development workshop day 7Advance Android application development workshop day 7
Advance Android application development workshop day 7
 
Advance Android application development workshop day 6
Advance Android application development workshop day 6Advance Android application development workshop day 6
Advance Android application development workshop day 6
 
Advance Android application development workshop day 3
Advance Android application development workshop day 3Advance Android application development workshop day 3
Advance Android application development workshop day 3
 
Advance Android application development workshop day 2
Advance Android application development workshop day 2Advance Android application development workshop day 2
Advance Android application development workshop day 2
 
Advance Android application development workshop day 1
Advance Android application development workshop day 1Advance Android application development workshop day 1
Advance Android application development workshop day 1
 
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
Students of Navgujarat College of Computer Applications, Ahmedabad felt excit...
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Advance Android application development workshop day 4

  • 1.
  • 2. Intent Allow you to interact with components from the own and other applications www.crescosolution.com
  • 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
  • 10. Sample AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="7" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:label="@string/app_name" android:name=".HelloWorld" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter></activity></application> </manifest> www.crescosolution.com