95-702 Distributed Systems 1!Master of Information System Management 95-702 Distributed Systems Lecture 17: A Short Introduction to Android Notes taken from Google’s Android SDK and Google’s Android Application Fundamentals95-702 Distributed Systems Plan For Today • Lecture on Core Android • Three U-Tube Videos: - Architecture Overview http://www.youtube.com/watch?v=Mm6Ju0xhUW8 - Application Lifecycle http://www.youtube.com/watch?v=fL6gSd4ugSI - Application Programmer Interfaces http://www.youtube.com/watch?v=MPukbH6D-lY 2!Master of Information System Management95-702 Distributed Systems Why Android? • Mobile platforms represent important components of distributed systems. • Android is a new and interesting mobile platform. • Android may also become important on non-mobile platforms. • We will look at Android from a developers point of view. 3!Master of Information System Management95-702 Distributed Systems What is Android? 4!Master of Information System Management Applications Contacts Phone Browser Home… Application Framework Window Manager Content Providers Location Manager Activity Manager … Libraries SQLite SSL WebKit Android Runtime VM… Linux Kernel WiFi Driver Binder (IPC) driver Camera Driver …95-702 Distributed Systems 5!Master of Information System Management System Architecture Diagram from Google95-702 Distributed Systems Linux Provides • Hardware abstraction – drivers • Memory management • Process Management • Security Model • Networking 6!Master of Information System Management95-702 Distributed Systems Native Libraries • Sit on top of Linux • Written in C/C++ • Drawing, Graphics (3D and 2D) • Media framework (codecs like MP4 to code and decode MP4 bit streams) • Font rendering • Database (SQLLite) • WebKit • Android runtime (VM) – mutiple instances 7!Master of Information System Management95-702 Distributed Systems Application Framework in Java (1) • Activity Manager • Package Manager • Windows Manager • Telephony Manager • Content Providers • Resource Manager • View System • Location Manager • Notification Manager • XMPP Service 8!Master of Information System Management This is a toolkit for applications. Applications are such things as the phone application and the contacts application.95-702 Distributed Systems Application Framework in Java (2) • Activity Manager Manages the lifecycle of applications. Applications cycle through various states: Started, Running, Background, Killed. Maintains a common stack allowing the user to navigate from one application to another. 9!Master of Information System Management95-702 Distributed Systems Application Framework in Java (3) • Package Manager Maintains information on the available applications on the device. 10!Master of Information System Management95-702 Distributed Systems Application Framework in Java (4) • Windows Manager Performs window management. 11!Master of Information System Management95-702 Distributed Systems Application Framework in Java (5) • Telephony Manager API’s needed to build the phone application and SMS. 12!Master of Information System Management95-702 Distributed Systems Application Framework in Java (6) • Content Provider Allows one application to make its data available to another. For example, the contacts application makes its data available to other applications that may need it. The phone or email application may need to consult contacts. 13!Master of Information System Management95-702 Distributed Systems Application Framework in Java (7) • Resource Manager Manages the storing of strings and layout files and bitmaps. “Android will run on many devices in many regions. To reach the most users, your application should handle text, audio files, numbers, currency, and graphics in ways appropriate to the locales where your application will be used”. (From the SDK) 14!Master of Information System Management95-702 Distributed Systems Application Framework in Java (8) • View System Contains the building blocks of the user interface – buttons, text boxes and so on. Handles event dispatching, layouts and drawing. The View class is the base class for the Widget class. All views in a window are organized in a single tree. 15!Master of Information System Management95-702 Distributed Systems Application Framework in Java (9) • Location Manager - Uses GPS – most accurate, slow, battery drain, and primarily for outdoor use. - Uses the Android Network provider which uses cell tower and wi-fi signals. 16!Master of Information System Management95-702 Distributed Systems Application Framework in Java (10) • Notification Manager Alerts the user about events. Status bar updates, flashing lights, vibrations and the like. 17!Master of Information System Management95-702 Distributed Systems Application Framework in Java (11) • XMPP Service IETF Standard: The Extensible Messaging and Presence Protocol (“Presence = ‘who’s online?) XML Based Internet Instant Messaging Adopted by GoogleTalk (Voice over IP and Instant Messaging) Provides for offline messaging. Unsure if still supported by Android. 18!Master of Information System Management95-702 Distributed Systems Example(1): Using The Telephony Manager • import android.telephony.TelephonyManager; • Your application requests READ_PHONE_STATE permissions. • Ask the system for a pointer to the TelephonyManager. • Register a listener for state changes. • Make calls on the TelephonyManager class. • The android.telephony.gsm package allows your application to send and receive SMS or MMS messages. 19!Master of Information System Management95-702 Distributed Systems Example (2): Using The Location Manager • Ask system for a pointer to the LocationManager. • Permissions requested in the manifest. • Implement a location listener. • Receive a GeoCoder object. • A GeoCoder provides geocoding and reverse geocoding. Geocoding is the process of transforming a street address or other description of a location into a (latitude, longitude)
View Full Document