Android ICC Part II Inter-component communication.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Advertisements

Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
Cosc 5/4730 Android Services. What is a service? From android developer web pages: Most confusion about the Service class actually revolves around what.
Android Security. N-Degree of Separation Applications can be thought as composed by Main Functionality Several Non-functional Concerns Security is a non-functional.
BroadcastReceiver.  Base class for components that receive and react to events  Events are represented as Intent objects  Intents received as parameter.
Cosc 5/4730 Android SMS. A note first Depending on the API level, an import changes because of a deprecated API 3 uses – import android.telephony.gsm.SmsManager;
System broadcasts and services. System broadcast events. EventDescription Intent.ACTION_BOOT_COMPLETEDBoot completed. Requires the android.permission.RECE.
Mobile Programming Pertemuan 6 Presented by Mulyono Poltek NSC Surabaya.
SMS. Short Message Service – Primarily text messages between mobile phones – First one sent December 3, 1982 “Merry Christmas” – In 2008 Approximately.
Android Security Enforcement and Refinement. Android Applications --- Example Example of location-sensitive social networking application for mobile phones.
Bluetooth. Bluetooth is an open, wireless protocol for exchanging data between devices over a short distance. –managed by the Bluetooth Special Interest.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
Understanding Android Security Yinshu Wu William Enck, Machigar Ongtang, and PatrickMcDaniel Pennsylvania State University.
Developing Push Notifications (C2DM) for Android Vijai Co-Founder Adhish Technologies, Sweet’N’Spicy apps.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
Mobile Computing Lecture#08 IntentFilters & BroadcastReceivers.
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.
Broadcast Receiver Android Club Agenda Broadcast Receiver Widget.
Integrating with Android Services. Introduction  Android has numerous built-in functionality that can be called from within your applications  SMS/MMS.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
Cosc 5/4730 Broadcast Receiver. Broadcast receiver A broadcast receiver (short receiver) – is an Android component which allows you to register for system.
Mobile Programming Lecture 6
Mobile Application Development using Android Lecture 2.
Erika Chin Adrienne Porter Felt Kate Greenwood David Wagner University of California Berkeley MobiSys 2011.
DUE Hello World on the Android Platform.
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
Developing Security Mobile Applications for Android Presenter, Joel Elixson Author, Jesse Burns of iSEC Partners.
Developing Secure Mobile Applications for Android CS 595 James Zachary Howland.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Android - Broadcast Receivers
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Storage Device Design Pattern JEFF MEISSNER; KEN HARDY Windows Program Management.
Mobile Application Security on Android Originally presented by Jesse Burns at Black Hat
Android System Security Xinming Ou. Android System Basics An open-source operating system for mobile devices (AOSP, led by Google) – Consists of a base.
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
Speech Service & client(Activity) 오지영.
Intents and Broadcast Receivers Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution.
David Sutton SMS TELEPHONY IN ANDROID. OUTLINE  This week’s exercise, an SMS Pub Quiz  Simulating telephony on an emulator  Broadcast Intents and broadcast.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Messaging and Networking. Objectives Send SMS messages using the Messaging app Send SMS messages programmatically from within your app Receive and consume.
Developing Android Services. Objectives Creating a service that runs in background Performing long-running tasks in a separate thread Performing repeated.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Cosc 4735 Nougat API 24+ additions.
More Security and Programming Language Work on SmartPhones
Mobile Applications (Android Programming)
Intents and Broadcast Receivers
Lecture 2: Android Concepts
CS499 – Mobile Application Development
Broadcast receivers.
CS371m - Mobile Computing Services and Broadcast Receivers
Instructor: Mazhar Hussain
Android System Security
Android Runtime – Dalvik VM
Messaging Unit-4.
Activities and Intents
Android Mobile Application Development
Reactive Android Development
Broadcast Receivers A Android Component where you can register for system or application events, receive and react to broadcast intent. Each broadcast.
Android Programming Lecture 9
Developing Android Services
Android Notifications (Part 2) Plus Alarms and BroadcastReceivers
Android Developer Fundamentals V2 Lesson 5
It is used to Start an Activity Start a Service Deliver a Broadcast
Lecture 2: Android Concepts
Mobile Programming Broadcast Receivers.
Presentation transcript:

Android ICC Part II Inter-component communication

Broadcast Receivers BRs are app components that receive intents sent from the system and/or other apps A BR has to register with the Activity Manager and Package Manager Registration can be done through the The manifest file Programmatically

BR registration within Manifest

BR registration within Manifest Class responsible for processing the Intent Filter to specify what intents to receive

BR program. registration IntentFilter filter = new IntentFilter(); filter.addAction(``pacman.intent.action.BROADCAST’’); receiver = new BroadcastReceiver() f public void onReceive(Context context, Intent intent) { System.out.println(``message receivednn''); } }; registerReceiver(receiver, filter);

BR program. registration IntentFilter filter = new IntentFilter(); filter.addAction(``pacman.intent.action.BROADCAST’’); receiver = new BroadcastReceiver() f public void onReceive(Context context, Intent intent) { System.out.println(``message receivednn''); } }; registerReceiver(receiver, filter); Filter to specify what intents to receive Action performed when the intent is received Registration of the BR and filter

Registering Broadcast Receivers When BRs are registered programmatically generate REGISTER_RECEIVER_TRANSACTION ioctl to AM via Binder Registration through manifest does not generate any transactions

Broadcasting Intents To broadcast an intent the sendBroadcast API should be used Generates a BROADCAST_INTENT_TRANSACTION ioctl to AM through the Binder Intent intent = new Intent(``pacman.intent.action.BROADCAST''); intent.putExtra(``message'',''Wake up.''); sendBroadcast(intent);

Content Providers CPs are the components in an app responsible for storing data CPs must be declared in the manifest file using the tag CPs are accessed by URI: content:// /

Content Providers Access to a CP is handled by the AM Ioctl with GET_CONTENT_PROVIDER_TRANSACTION Specifying the authority The AM finds the suitable CP and sends back a handler to communicate directly with the CP Then the app can send URI along with the requested operations: QUERY_T, GET_TYPE_T, INSERT_T, DELETE_T, UPDATE_T, BULK_INSERT_T, OPEN_FILE_T, OPEN_ASSET_FILE_T

Service Manager The Service Manager is a special system service to keep track of the services available in a device An app that wants to provider a service to others can publish its service through the SM Communication to SM is done through Binder

Service Manager Commands The SM accepts the following commands: publish: takes two arguments – service name and address. This is used for publishing a service within the SM get/check: take one argument – service name. The SM returns a address of the service in the form of a handler list: this lists the service names registered with the SM

Service Manager in Action

Service Manager ioctl ioctl on /dev/binder with BINDER_WRITE_READ cmd:BC_TRANSACTION: target name = android.os.IServiceManager code = SVC_MGR_GET_SERVICE service name = isms

Final Thoughts Android ICC is both very powerful and flexible High-level API for dynamic interaction between apps Discovery of functionality on the fly If not protected properly it can lead to serious consequences

Questions?