SlideShare a Scribd company logo
ANDROID TRAINING
SESSION – 3
-Hussain KMR Behestee
AGENDAS
• Intents
– Explicit Intents
– Implicit intents
• Broadcast Receivers
• Notifications & Toasts
EXPLICIT INTENTS
• We saw some Explicit Intents in previous
session.
• Today we will see few more, like as
– Start another activity
– Start another activity with sending data
– Start another activity for getting result
START ANOTHER ACTIVITY
• Start another activity
• Start another activity with sending data
• Receive data
START ANOTHER ACTIVITY FOR
GETTING RESULT
• Start activity to get result
• Callback
START ANOTHER ACTIVITY FOR
GETTING RESULT
• Send back to caller activity
• Please see here for details.
IMPLICIT INTENT
• Implicit intent are those which intents have no
specific activity to show. We will learn here-
– Call other app to share your content
– Allow other apps to start your activity
– Call other app to do a task
– Caution
CALL OTHER APP TO SHARE YOUR
CONTENT
• Initiating call-
• This will show all applications
which are registered for this type.
• To get registered to response you
have allow them.
ALLOW OTHER APP TO START YOUR
ACTIVITY
• Add Intent Filter to manifest
• Add mime type as much you want to register.
EXTRA
• Install apps to simulator
– adb install <file>
IMPLICIT INTENT: CAUTION
• Caution: If you invoke an intent and there is no app available on the device
that can handle the intent, your app will crash.
• To verify there is an activity available that can respond to the intent, call
queryIntentActivities() to get a list of activities capable of handling your
Intent. If the returned List is not empty, you can safely use the intent. For
example:
• Please see details at here.
CALL OTHER APP TO SHARE YOUR
CONTENT
• Safe call with create chooser
BROADCAST RECEIVERS
• A broadcast receiver is a component that
responds to system-wide Broadcast
announcements.
• Many broadcasts originate from the system
– For example, a Broadcast announcing that the
screen has turned off, the battery is low, or a
picture was captured or an SMS is received.
BROADCAST RECEIVERS
• Applications can also initiate broadcasts—for
example, to let other applications know that
some data has been downloaded to the
device and is available for them to use.
• Although broadcast receivers don't display a
user interface, they may create a status bar
notification to alert the user when a broadcast
event occurs.
BROADCAST RECEIVERS
• To receive a broadcast when SMS received
BROADCAST RECEIVERS
• In manifest
NOTIFICATION
• Toast Display
– Toast.makeText(context, str,Toast.LENGTH_LONG).show();
• Notification drawer
– On Next Session ;-)
QUESTION?
THANK YOU

More Related Content

PDF
Validating big data at scale
PPTX
Hpmled cloud control led display
PPTX
Android session 2-behestee
PPTX
iOS app dev Training - Session1
PPTX
Android session 4-behestee
PPTX
CodeCamp general info
PPTX
Unit - III.pptx
PPTX
W5_Lec09_Lec10_Intents.pptx
Validating big data at scale
Hpmled cloud control led display
Android session 2-behestee
iOS app dev Training - Session1
Android session 4-behestee
CodeCamp general info
Unit - III.pptx
W5_Lec09_Lec10_Intents.pptx

Similar to Android session 3-behestee (20)

PPTX
Data Transfer between Activities & Databases
PPTX
App Fundamentals and Activity life cycle.pptx
PPTX
Basics 4
PPTX
Data Transfer between activities and Database
PDF
Android Activities.pdf
PDF
Ch5 intent broadcast receivers adapters and internet
PPT
Android_ver_01
PDF
android_mod_3.useful for bca students for their last sem
PPTX
Introduction to Android Development
PPTX
Modul 2.pptxhelllojobbigtufytfythjgjhbknkjlnlk
PPTX
MAD unit 5.pptxyfc8yct7xugxigc8yc8c7yc7gc8yc
DOCX
Using intents in android
PPTX
Broadcast receivers
PDF
Android Application Components
PPTX
Android - Broadcast Receiver
PDF
Creating an app on Ribily Part 3 - flow creation
PDF
Creating an app on Ribily Part 3 flow creation
PPTX
Mobile Application Guideline | Mobile App Development Company
PPT
ANDROID
PDF
DEVICE SECURITY(BE PROTECTED FROM LOAN MAFIAS)
Data Transfer between Activities & Databases
App Fundamentals and Activity life cycle.pptx
Basics 4
Data Transfer between activities and Database
Android Activities.pdf
Ch5 intent broadcast receivers adapters and internet
Android_ver_01
android_mod_3.useful for bca students for their last sem
Introduction to Android Development
Modul 2.pptxhelllojobbigtufytfythjgjhbknkjlnlk
MAD unit 5.pptxyfc8yct7xugxigc8yc8c7yc7gc8yc
Using intents in android
Broadcast receivers
Android Application Components
Android - Broadcast Receiver
Creating an app on Ribily Part 3 - flow creation
Creating an app on Ribily Part 3 flow creation
Mobile Application Guideline | Mobile App Development Company
ANDROID
DEVICE SECURITY(BE PROTECTED FROM LOAN MAFIAS)
Ad

Recently uploaded (20)

PDF
VCE English Exam - Section C Student Revision Booklet
PDF
01-Introduction-to-Information-Management.pdf
PPTX
master seminar digital applications in india
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Classroom Observation Tools for Teachers
PDF
Complications of Minimal Access Surgery at WLH
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Lesson notes of climatology university.
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Insiders guide to clinical Medicine.pdf
VCE English Exam - Section C Student Revision Booklet
01-Introduction-to-Information-Management.pdf
master seminar digital applications in india
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Final Presentation General Medicine 03-08-2024.pptx
Basic Mud Logging Guide for educational purpose
Supply Chain Operations Speaking Notes -ICLT Program
Abdominal Access Techniques with Prof. Dr. R K Mishra
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Computing-Curriculum for Schools in Ghana
Renaissance Architecture: A Journey from Faith to Humanism
Classroom Observation Tools for Teachers
Complications of Minimal Access Surgery at WLH
Anesthesia in Laparoscopic Surgery in India
Lesson notes of climatology university.
O7-L3 Supply Chain Operations - ICLT Program
Microbial diseases, their pathogenesis and prophylaxis
2.FourierTransform-ShortQuestionswithAnswers.pdf
Insiders guide to clinical Medicine.pdf
Ad

Android session 3-behestee

  • 1. ANDROID TRAINING SESSION – 3 -Hussain KMR Behestee
  • 2. AGENDAS • Intents – Explicit Intents – Implicit intents • Broadcast Receivers • Notifications & Toasts
  • 3. EXPLICIT INTENTS • We saw some Explicit Intents in previous session. • Today we will see few more, like as – Start another activity – Start another activity with sending data – Start another activity for getting result
  • 4. START ANOTHER ACTIVITY • Start another activity • Start another activity with sending data • Receive data
  • 5. START ANOTHER ACTIVITY FOR GETTING RESULT • Start activity to get result • Callback
  • 6. START ANOTHER ACTIVITY FOR GETTING RESULT • Send back to caller activity • Please see here for details.
  • 7. IMPLICIT INTENT • Implicit intent are those which intents have no specific activity to show. We will learn here- – Call other app to share your content – Allow other apps to start your activity – Call other app to do a task – Caution
  • 8. CALL OTHER APP TO SHARE YOUR CONTENT • Initiating call- • This will show all applications which are registered for this type. • To get registered to response you have allow them.
  • 9. ALLOW OTHER APP TO START YOUR ACTIVITY • Add Intent Filter to manifest • Add mime type as much you want to register.
  • 10. EXTRA • Install apps to simulator – adb install <file>
  • 11. IMPLICIT INTENT: CAUTION • Caution: If you invoke an intent and there is no app available on the device that can handle the intent, your app will crash. • To verify there is an activity available that can respond to the intent, call queryIntentActivities() to get a list of activities capable of handling your Intent. If the returned List is not empty, you can safely use the intent. For example: • Please see details at here.
  • 12. CALL OTHER APP TO SHARE YOUR CONTENT • Safe call with create chooser
  • 13. BROADCAST RECEIVERS • A broadcast receiver is a component that responds to system-wide Broadcast announcements. • Many broadcasts originate from the system – For example, a Broadcast announcing that the screen has turned off, the battery is low, or a picture was captured or an SMS is received.
  • 14. BROADCAST RECEIVERS • Applications can also initiate broadcasts—for example, to let other applications know that some data has been downloaded to the device and is available for them to use. • Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs.
  • 15. BROADCAST RECEIVERS • To receive a broadcast when SMS received
  • 17. NOTIFICATION • Toast Display – Toast.makeText(context, str,Toast.LENGTH_LONG).show(); • Notification drawer – On Next Session ;-)