| Free tutorials for Java, Eclipse and Web programming |
Version 3.3
Copyright © 2009 - 2010 Lars Vogel
24.06.2010
| Revision History | ||
|---|---|---|
| Revision 0.1 | 04.07.2009 | Lars Vogel |
| Created | ||
| Revision 0.2 - 0.3 | 08.07.2009 - 30.08.2009 | Lars Vogel |
| First working example | ||
| Revision 0.4 | 30.10.2009 | Lars Vogel |
| Updated to use Android 2.0 | ||
| Revision 0.5 - 2.5 | 01.11.2009 - 10.05.2010 | Lars Vogel |
| Several bugs fixed | ||
| Revision 2.6 | 23.05.2010 | Lars Vogel |
| Update to Android 2.2 | ||
| Revision 2.7 - 3.3 | 30.05.2010 - 24.06.2010 | Lars Vogel |
| bug fixing and enhancements | ||
Table of Contents
Android is an operating system based on Linux with a Java programming interface. It provides tools, e.g. a compiler, debugger and a device emulator as well as its own Java Virtual machine (Dalvik Virtual Machine - DVM). Android is created by the Open Handset Alliance which is lead by Google.
Android uses a special Java virtual machine (Dalvik) which is based on the Apache Harmony Java implementation. Dalvik uses special bytecode. Therefore you cannot run standard Java bytecode on Android but you have to use the Android compiler to create Android specific byte-code.
Android supports 2-D and 3-D graphics using the OpenGL libraries and supports data storage in a SQLLite database.
For development Google provides the Android Development Tools (ADT) for Eclipse to develop Android applications.
Every Android applications runs in its own process and it isolated from other running applications. Therefore on misbehaving application cannot harm other Android applications.
An Android application consists out of the following parts:
Activity - A screen in the Android application
Services - Background activities without UI
Content Provider - provides data to applications, Android contains a SQLLite DB which can serve as data provider
Broadcast Receiver - receives system messages, can be used to react to changed conditions in the system
Intends allow the application to request and / or provide services . For example the application call ask via an intent for a contact application. Application register themself via an IntentFilter. Intends are a powerful concept as they allow to create loosely coupled applications.
An Android application is described the file "AndroidManifest.xml". This files contains all activities application and the required permissions for the application. For example if the application requires network access it must be specified here. "AndroidManifest.xml" can be thought as the deployment descriptor for an Android application.
The class android.content.Context provides the connections to the Android system. Contexts provides the method getSystemService which allows to receive a manager object for the different hardware parts. As Activities and Services extend this class you can directly access the context via "this".