Intents.

Slides:



Advertisements
Similar presentations
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Advertisements

Managing Users. Overview for School Admin Users Define Users Users Module Add Users Importing Users and Groups Manually adding users Search for Users.
Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
Programming with Android: Activities and Intents Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Programming with Android: Activities and Intents Luca Bedogni Marco Di Felice Dipartimento di Informatica – Scienza e Ingegneria Università di Bologna.
INTRO TO MOBILE APP DEVELOPMENT CMSC 150: Lecture 34.
 An archive file marked by an.apk suffix.  Java code + any data +resource files  is bundled by the aapt tool into an aapt tool ◦ Android Asset Packaging.
Intents and Intent Filters.  Intents are data structures that specify  Operations to be performed  Events that have occurred  Broadcast by one component.
Mobile Application Development
Mobile Programming Pertemuan 6 Presented by Mulyono Poltek NSC Surabaya.
SMS Module. CLOUD SMS GATEWAY SUGAR INSTANCE SMS PROVIDER MOBILE.
Intent An Intent describes the operation to be performed. Intents are used to start an activity using either of the following methods – Context.startActivity()
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Lecture 3 agenda Layouts Intents (both explicit and implicit) ListViews and Adapters.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Server-side Scripting Powering the webs favourite services.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 5: Investigate! Android Lists, Arrays,
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
Intent Android Club Agenda Intent class Explicit activation Implicit activation.
CS378 - Mobile Computing Intents.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Overview of Android Application Development
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
System Initialization 1)User starts application. 2)Client loads settings. 3)Client loads contact address book. 4)Client displays contact list. 5)Client.
Website Development with PHP and MySQL Saving Data.
Android Boot Camp for Developers Using Java, 3E
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.
Networking: Part 1 (Web Content). Networking with Android Android provides A full-featured web browser based on Chromium, the open source browser engine.
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.
Cosc 5/4730 Android Communications Intents, callbacks, and setters.
Linking Activities using Intents How to navigate between Android Activities 1Linking Activities using Intents.
Working with Multiple Activities. Slide 2 Introduction Working with multiple activities Creating multiple views Introduction to intents Passing data to.
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.
EPICOLLECT Maggie Ortiz, EERI. EpiCollect Tutorial  This is a short tutorial prepared by EERI to walk you through creating an entry using EpiCollect.
Intents 1 CS440. Intents  Message passing mechanism  Most common uses:  starting an Activity (open an , contact, etc.)  starting an Activity.
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
Intents and Broadcast Receivers Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution.
Working with Multiple Activities. Slide 2 Introduction Working with multiple activities Putting together the AndroidManifest.xml file Creating multiple.
Editing a Twitter search. Viewing search results in a browser.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Android Mobile Application Development
Intents and Broadcast Receivers
Lecture 2: Android Concepts
Android 01: Fundamentals
Programming with Android:
Android 5: Interacting with Other Apps
Linking Activities using Intents
Lecture 3 agenda A tour of Android studio features
Mobile Application Development BSCS-7 Lecture # 3
CS371m - Mobile Computing Intents.
Android Programming Lecture 5
How to send messages to students and other SimpleVLE users
Activities and Intents
Android Topics What are Intents? Implicit Intents vs. Explicit Intents
Add to the Coffee Ordering App
Activities and Intents
Android Intents & Sensors
It is used to Start an Activity Start a Service Deliver a Broadcast
Mobile Programming Dr. Mohsin Ali Memon.
Android Development Tools
Presentation transcript:

Intents

Fancy pants definition of Intent A passive data structure holding an abstract description of an operation to be performed or a description of something that has happened and is being announced.

Regular pants definition Intents are asynchronous messages which allow Android components to request functionality from other components of the Android system. Allows developers to leverage the capability of other apps

Using Intents Intents are sent to the Android system via the startActivity(). Depending on how the Intent was constructed, the Android system will run an receiver and determine possible components that can be started. If several components have registered for the same intents the user can decide which component should be started.

How we’ve used Intents so far An Intent object is passed to Context.startActivity() or Activity.startActivityForResult() to launch an activity or get an existing activity to do something new. It can also be passed to Activity.setResult() to return information to the activity that called startActivityForResult().

Explicit vs Implicit Intents Explicit intents explicitly define the component which should be called by the Android system by using the Java class as the identifier. Implicit intents specify the action which should be performed and optional data which provides data for the action.

Intents Intents can contain Component Name Action Data

Intents : Component Name The name of the component that should handle the intent. The name of the component should be a fully qualified class name of the target component its package name.  Package name Fully Qualified Class Name com.example.project.app.FreneticActivity

Intents : Component Name Explicit Intents need a component name Implicit Intents do NOT need a component name

Intent : Action A string naming the action to be performed

Intent : Data The data to operate on, such as a person record in the contacts database, expressed as a Uri.

Examples of Action/Data pairs ACTION_VIEW content://contacts/people/1 -- Display information about the person whose identifier is "1". ACTION_DIAL content://contacts/people/1 -- Display the phone dialer with the person filled in. ACTION_VIEW tel:123 -- Display the phone dialer with the given number filled in. Note how the VIEW action does what is considered the most reasonable thing for a particular URI. ACTION_DIAL tel:123 -- Display the phone dialer with the given number filled in. ACTION_EDIT content://contacts/people/1 -- Edit information about the person whose identifier is "1". ACTION_VIEW http://www.google.com -- Display the browser with the given url filled in.

Example Intents : Long Way Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.smu.edu")); startActivity(intent);

Example Intents : Compact Way Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent);

Show Phone Number in Dialer App ////Show Phone number in Dialer App Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tel:2147681234")); startActivity(intent);

Google Search ////Open browser and perform a google search Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY, "SMU"); startActivity(intent);

Open Address in Google Maps //Open Google Maps and load a map for a specific geo location Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:32.84453,-96.78534")); startActivity(intent);

Compose an Email //Compose an email with subject and body filled in Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:?subject=" + Uri.encode("Mixed Berry Recipe") + "&body=" + Uri.encode("I found this awesome recipe"))); startActivity(intent);

Choose an Activity to share data with //Send data to any app that accepts text/plain mime type Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, "Subject Here"); intent.putExtra(Intent.EXTRA_TEXT, "Body Here"); //This will create a chooser pop-up that allows the user to select from a list of options for how they //want to handle the intent (which app to use). startActivity(Intent.createChooser(intent, "Share this recipe with")); //Add special text to chooser pop-up

Edit Contact //Edit a contact in your contacts list Intent intent = new Intent(Intent.ACTION_EDIT, Uri.parse("content://contacts/people/1")); startActivity(intent);