Android Topics What are Intents? Implicit Intents vs. Explicit Intents

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Basic Communication on the Internet:
1 Unit & District Tools Phase 1. 2 To access the new Unit and District Tools, you will need to click on the link embedded in the MyScouting Flash page.
Intents.
Mobile Application Development
Intent An Intent describes the operation to be performed. Intents are used to start an activity using either of the following methods – Context.startActivity()
Using Microsoft Outlook: Basics. Objectives Guided Tour of Outlook –Identification –Views Basics –Contacts –Folders –Web Access Q&A.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 5: Investigate! Android Lists, Arrays,
Unit B: Expanding Your Productivity Page: 24 to 37.
Intent Android Club Agenda Intent class Explicit activation Implicit activation.
CS378 - Mobile Computing Intents.
Click your mouse to continue. Ways to Merge Data When you have finished editing your main document and inserting the merge fields, you have several choices.
The Internet 8th Edition Tutorial 2 Basic Communication on the Internet: .
1 Tradedoubler & Mobile Mobile web & app tracking technical overview.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Intent Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Outlook Web App Crash course. Outlook Agenda Login Login Reset Password Reset Password Getting Started in Outlook Web App Getting Started in Outlook Web.
Android Development 1 Yuliana Setiowati Rizky Yuniar Hakkun Ahmad Syauqi Ahsan.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Lec 03 Intents Explicit Intents Implicit Intents.
Lec 04 Intents and Bundles Fragments. Activated by Intents Activities Services Broadcast Receivers (aka Receivers) (
Introducing Intents Intents Bind application components and navigate between them Transform device into collection of interconnected systems Creating a.
Android Intents Nasrullah. Using the application context You use the application context to access settings and resources shared across multiple activity.
Lecture 2: Android Concepts
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
Awareness raising session for Parents and Carers June Todd Awareness raising session for Parents and Carers June Todd.
Dextrosoft SCHEDULED PHONE BACKUP Backup your mobile life Version Copyright © 2015 Dextrosoft Private Limited. All Rights Reserved.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
A Web Coordinator guide to creating links. Other tabs and buttons in the ‘create link’ menu: ‘Querysting’ – these are useful for creating ‘pagejumps’
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Unit & District Tools Phase 1
Android Mobile Application Development
More Security and Programming Language Work on SmartPhones
& Google Gmail.
Project Management: Messages
Lecture 2: Android Concepts
SPen & Camera Kit Experience App
Android 01: Fundamentals
Outlook Mobile App for Android
Print Out Text Messages from Android Phone Mac/Win
Working with Google Applications Gmail, a popular
elp.
Lesson 11: Web Services & API's
How to Troubleshoot Sync Errors with the Gmail Android App?
How to register and use ODMAP for Fire/EMS and other partners
How To Use As Another Account On Gmail
Easy way to download Flash Keyboard APK for Android
Android Programming Lecture 5
Why we should be texting with our customers
First, use our API Builder at www. apilinkbuilder
Using K2 applications How can users interact with K2 applications?
Application Development A Tutorial Driven Course
Android Topics UI Thread and Limited processing resources
Add to the Coffee Ordering App
Android Topics Limited Resources and why we need to consider them.
Activities and Intents
Download the APhA 2018 app Scan the QR code or search for APhA in iTunes or APhA Annual in the Google Play store. For all other device types (including.
It is used to Start an Activity Start a Service Deliver a Broadcast
Using Microsoft Outlook: Outlook Support Number
Lab 2: Information Retrieval
Mobile Programming Dr. Mohsin Ali Memon.
Google Account Recovery Process
SETUP ALEXA APP Setup Alexa on your favorite device and control your smart device with the help of Alexa.
Microsoft Teams User Interface
Presentation transcript:

Android Topics What are Intents? Implicit Intents vs. Explicit Intents What is the content of an Intent message? Practice: In-Class App

What are Intents? Most apps require us to send intents   Example: the Coffee Ordering App will require us to send off the order summary in an email. The app must launch an email app that exists on the device.  An intent is a message that requests some type of action to be performed by another app component. This could be a camera, email, Google Maps, or even an activity in another app.

Why are Intents Important? Intents are a powerful part of the Android framework. They allow apps to leverage functionality that other apps provide. They let developers be efficient and smart, because we're not reinventing what other apps already do extremely well.  

How Intents work Intents are like tossing a ball to someone. An app component can send an intent to another app or app component. Email Camera Map

Implicit Intents vs. Explicit Intents There are two types of intents: Implicit and Explicit. An intent can be sent to an explicit app or component. An Intent can be sent implicitly.

Implicit Intent An Implicit Intent specifies only the action to be performed. An Implicit Intent does not specify the explicit Android components which should be called. As an analogy, imagine that we need you throw the ball, but we don't have to know who we're throwing it at, as long as there is someone there to catch it. Implicit – doesn’t care who catches it.

Implicit Intent Example Google Maps provides a restaurant listing. Clicking on Website sends an intent to display the restaurant website.

Implicit Intent Example Result Google Maps app does not care which web browser handles the website launch request.  If the user only has one web browser installed on their device, then that app will automatically handle the request. If the user has four web browsers installed on their device, then the Android framework will pop up a window to ask the user to just pick one.

Explicit Intent Sometimes we want to be 100% sure that when we send an intent. Perhaps we want a very specific component to receive it. We will discuss this more next week. Explicit– Does care who catches it.

What is the content if an Intent message What is the content if an Intent message? What is contained inside the ball that represents an intent? Think of an intent as a message specifying some operation to be performed. Intents contain two primary elements and possibly extra elements. The general action and Data to act upon. You can also specify additional information such as category, component, and extras, which is literally extra information.

Intent message The general action and and the Data to act upon are used by Android to determine which app component can actually handle the intent. TIP: Use Android’s the Common Intents guide for understanding the options when creating intents.

Example Intent messages Map Example An implicit ntent that launches a map would contain the action ACTION_VIEW, and the data would be the latitude and longitude coordinates of the location that we want to see. Any app that is capable of displaying map using latitude and longitude coordinates can be used to handle the request, such as a map application. Phone Calling Example An implicit intent to dial a phone number would require the action ACTION_DIAL and the corresponding data is the telephone number to call. The data format is in the form tel, colon, followed by the number. Email Example An implicit intent to send an email would require the action ACTION_SENDTO and the corresponding data is the email address. The data format is in the form mailto:trish_cornez@redlands.edu.

What is a URI? URI is a formatted string and is short for uniform resource identifier. This is a standardized way to structure data so that it can be properly processed on the receiving end. Think about it like a mailing address, it follows a structure so that it can be delivered properly. When sending an intent, a URI is needed so that the data can be properly passed to the receiving app component.

Experiment : Lab 4 Exercise 1  Provide a button for the user to access downtown Redlands in Google Maps. Use an implicit intent in the creation of the app.

Tasks: Map App Task 1: Locate the longitude and latitude of a place. geo:Latitude,Longitude. Task 2: Research how to create a simple geolocation intent https://developer.android.com/guide/components/intents-common Take some time to experiment with writing code for different intents listed in the Common Intents guide. You can also do a web search for common intents. The documentation has some useful Task 3: Learn how you can to set the data for an intent. Task 4: Learn how you can check to see if the correct component is available on the device.

What did you find in your research? Create a new Intent object and pass it a ACTION_VIEW. When composing our Intent, we will use an official intent action, such ACTION_VIEW or ACTION_SEND, which are defined as constants within the Intent class. Set the data URI to be a certain set of latitude and longitude coordinates. a. Create a URI string. b. URI is set as the data field within this Intent object. To prevent the app from crashing, check to see if the Intent can be handled. If there's no app component on the device that can handle this Intent, then we skip sending the Intent.