AND103 - Android "Internet" Network Programming (4 days)
Course Outline
This course concentrates on the internet programming aspects of developing Android mobile applications.
Topics covered include working with the HttpClient, external JARs, local and remote services as well as integrating media players and web based resources into applications. Notifications, location tracking and Google maps are also covered.
Course Objectives
The goals of this course are to explore the "networking" aspects of Android application development in greater depth than could be covered in a more general Android programming course.
Prerequisites
The course assumes that attendees are already familiar with HTML, Javascript and Java programming as well as basic Android application development techniques.
Course Contents
Overview of the HTTP protocol
Displaying HTTP pages on mobile phones and designing mobile phone oriented HTML sites
Overview of the Android HttpClient class and low level HTTP client side programming
- Executing HTTP requests
- Handling Cookies
- Authentication
- Connection management
- Thread safety aspects of HTTP clients
XML and JSON
- Overview of XML
- Principles of Parsing XML documents - SAX and DOM
- Overview of JSON
- Android JSON and XML programming
REST (Representational State Transfer)
- Concepts
- Protocols
- Implementing 'RESTful' Android clients
Incorporating JARs into Android projects
- Using JARs to extend Android functionality
- Patterns and mechanisms of working with libs/directory
- Integrating third party JARs into applications
- Overview of Twitter and Facebook API wrappers for Android
- Developing Twitter and Facebook applications
Local Service Creation
- Concepts and roles of services
- Service lifecycles
- State sharing in local services
- Multi-threading and local services
- Using local services
- Stopping and starting services
- Obtaining updates using shared state
- Obtaining updates using Intents and BroadcastReceivers
Remote Services
- Concept and Role of remote services
- AIDL interfaces - an overview
- Exporting and importing AIDL interfaces
- Service to client callbacks
Notifications
- Concept and Role of notifications
- Raising a notification
- Using hardware to augment notifications
- Reacting to selected notifications
- Selectively responding to notification-worthy events
Location Tracking
- Understanding the Android location tracking model
- Processing location updates when a device is "on the move"
- Obtaining the most recent location fix
- Designing and implementing applications that use proximity alerts
Choosing providers via criteria
Maps
- Overview of Google maps
- Rules and API keys
- Adding a map with centre and zoom levels to an application
- Overlays - concepts, design and use patterns
- Designing and implementing custom overlays with push-pins
- Zoom controls
Media
- Overview of audio and video formats
- Audio and video playback
- Incorporating streaming audio and video into applications
Developing mobile rich internet applications (RIA) using WebView
- Integrating WebView into Android applications
- Launching a standalone Browser activity
- Loading local content
- Handling link clicks
- Exposing Java code to Javascript
- Calling back into Javascript from Java