MOBILE

Android’s Securable IPC Mechanisms

10/11/2010 1:59:28 PM
Android implements a few key tools used to communicate with or coordinate between programs securely. These mechanisms give Android applications the ability to run processes in the background, offer services consumed by other applications, safely share relational data, start other programs, and reuse components from other applications safely.

Much of the interprocess communication (IPC) that occurs on Android is done through the passing around of a data structures called Intents. These are collections of information that have a few expected properties the system can use to help figure out where to send an Intent if the developer wasn’t explicit. The Action property expresses what the Intent is for (the Intent.ACTION_VIEW action indicates that the data is to be displayed to the user, for example). The data property is an optional URI and could point to a file, contact, web page, phone number, and so on. Intents also potentially have a collection of key/value pairs called extras, as well as flags, components, and other more advanced features, only some of which we will discuss.

Each of these IPC mechanisms uses Intents in some capacity and is probably somewhat familiar to most Android developers. However, because using these safely is key to Android security, let’s briefly review each mechanism:

Activities

Activities are interactive screens used to communicate with users. A “Hello World” Android application is just an Activity, configured with a resource that says “Hello World.” Intents are used to specify an Activity, and this may be done ambiguously to allow the user to configure their preferred handler.

Broadcasts

Broadcasts provide a way to send messages between applications—for example, alerting listeners to the passage of time, an incoming message, or other data. When sending a broadcast an application puts the message to be sent into an Intent. The application can specify which Broadcasts they care about in terms of the Intents they wish to receive by specifying an IntentFilter.

Services

Services are background processes that toil away quietly in the background. A service might play music; others handle incoming instant messages, file transfers, or e-mail. Services can be started using an Intent.

ContentProviders

ContentProviders provide a way to efficiently share relational data between processes securely. They are based on SQL and should be used carefully. Some of the nice user interface (UI) widgets Android provides make using ContentProviders very tempting, even when data isn’t highly relational. ContentProviders can be secured with Android permissions, and used to share data between processes, like files might be on traditional Unix like systems.

Binder

Binder provides a highly efficient communication mechanism on Android. It is implemented in the kernel, and you can easily build RPC interfaces on top of it using the Android Interface Definition Language (AIDL). Binder is commonly used to bridge Java and native code running in separate processes.

Other  
  •  CSS for Mobile Browsers : CSS Techniques
  •  CSS for Mobile Browsers : Selectors
  •  CSS for Mobile Browsers : Where to Insert the CSS
  •  iPhone Programming : Creating a Table View
  •  iPhone Programming : Simplifying the Template Classes
  •  Mobile SEO
  •  Building Android Apps : Adding Basic Behavior with jQuery
  •  Adding the Android Look and Feel
  •  Adding the Android CSS
  •  Building Android Apps : Basic Styling
  •  Building Android Apps : Web Programming Crash Course
  •  Synchronizing Mobile Data : Using RDA
  •  Installing Remote Data Connectivity
  •  Understanding SQL Server CE Synchronization
  •  Cocoa Fundamentals
  •  Tracing the iPhone Application Life Cycle
  •  Inside Cocoa Touch : Exploring the iOS Technology Layers
  •  The Language of Apple Platforms : Memory Management
  •  The Language of Apple Platforms : Objective-C Programming Basics
  •  The Language of Apple Platforms : Exploring the Objective-C File Structure
  •  
    Top 10
    Has Apple Lost It? (Part 2)
    Has Apple Lost It? (Part 1)
    Sony Computer Entertainment (Part 3)
    Sony Computer Entertainment (Part 2)
    Sony Computer Entertainment (Part 1)
    Sony's 4K Ultra World - Ready For Yet Another Resolution Revolution
    Analyze This - Wi-Fi Nets Via Smartphone (Part 2)
    Analyze This - Wi-Fi Nets Via Smartphone (Part 1)
    Devolo dLAN 500 AV Wireless + Starter Kit
    The Slithery World Of Hybrid Cloud Security
    Most View
    Audio Technica ATH-FC707 - No Headline, Too Busy Enjoy Music
    What To Do With An Old Mac (Part 4)
    Programming Microsoft SQL Server 2005: Using Data Mining Extensions (part 1) - Data Mining Modeling Using DMX
    IFA 2012 Already Overbooked! (Part 2)
    Dropbox : Let's "drop" your files
    ZyXEL PL4201 Powerline Adaptor
    Managing the Cache
    Microsoft ASP.NET 3.5 : The HTTP Request Context - Initialization of the Application
    Patriot Gauntlet Node - BYO Media Streamer
    Exchange Server 2010 : Keep Exchange Healthy (part 2) - Verify Exchange Server Health
    MSI Power Edition GeForce GTX 670
    Microsoft .NET : Design Principles and Patterns - From Objects to Aspects (part 1) - Aspect-Oriented Programming
    Tips And Tricks To Set You Apart From The Tech Crowd (Part 3)
    What Might Have Been
    Installing a Clean Version of Windows Server 2008 R2 Operating System (part 2) - Finalizing the Installation and Customizing the Configuration
    Cheap As Chips: Six Of The Best Budget CPUs (Part 2) : INTEL Core i3-3220, INTEL Core i3-3225
    iPad Mini Test (Part 3)
    The HP Virtual Server Environment : The Partitioning Continuum at a Glance
    Top Tips For Mountain Lion (Part 4)
    Panasonic Added Advanced Ultra High Zoom And Mirrorless Cameras : DMC-G5, DMC-FZ200, FZ60, DMC-S, LS205