Introduction to Android

cnet review Nov 2008

wikipedia reference

important article about history

Mobile phones run on different oses including proprietary

Rich Miner founder of Android

Search for: Rich Miner founder of Android

long press in mobile phones

Search for: long press in mobile phones

pinching and zooming in android

Search for: pinching and zooming in android

which linux distribution is in Android

Search for: which linux distribution is in Android

Linux compatibility

what is android libc

Search for: what is android libc

How does android java differs from JDK?

Search for: How does android java differs from JDK?

What is Open GL ES?

Search for: What is Open GL ES?

What is the architecture of android preferences?

Search for: What is the architecture of android preferences?

Are there any sites to learn about OpenGL on the web?

Search for: Are there any sites to learn about OpenGL on the web?

What are some good books to learn OpenGL from?

Search for: What are some good books to learn OpenGL from?

What do you use java.sql for in android?

Search for: What do you use java.sql for in android?

What on earth is GSM telephony?

Search for: What on earth is GSM telephony?

A standard for mobile phones allowing roaming among carriers. It is a digial system. It is also called 2G for second generation. GSM allowed SMS, a text messaging service. Allowed a universal emergency number "112" anywhere in the world. In 97 it added General Packet Radio Service (GPRS). In 99 allowed higher data transmission speeds using Enhanced Data Rates for GSM evolution (EDGE). GSM is a standard for cellular networks. GSM operates in 4 frequency ranges 900Mhz, 1800Mhz, 850Mhz, 1900 Mhz, 400 Mhz, 450Mhz. GSM also specifies sampling rate, transmission speed, and cell types. The maximum distance GSM allows is 35Km. GSM uses frequency modulation that varies frequencies in addition called Gaussian minimum-shift keying (GMSK)

The concept of SIM is essentially a GSM concept. It is possible to lock a SIM through SIM locking. It is not allowed to lock SIMs in some countries.

Considered next generation of GSM. Often also called 3G. UMTS uses "code division multiple access" (CDMA) as opposed to "Time Division Multiple Access" (TDMA) to accomodate higher speeds. It can support 14Mb/sec data transfer rate. However current 3G handsets may be supporting only 400Mb/sec in practice. Advanced GSM using packet switching can support 56kbps. with EDGE you can reach 180kbps. HSDPA (High Speed Downlink Packet Access) enables download speeds of 7.2mbs. Next evolution of UMTS (4G) is expected to support 100mbps down and 50mbps up using orthogonal frequency-division multiplexing. The 3G frequencies are 850/900/1700/2100. There are no universal handsets that support all these frequencies. With 2G and 3G combined there are over 11 frequency bands that are in use.

is a wireless broadband data access standard for DSL like data speeds with out any need for hosspots. data speeds are 500kbps to 1000kpbs. Unlike GSM it is not a mobile standard but a general purpose data standard like wi-fi. On an edge network (GSM based) it may take 90 seconds to download 1 Mb of file. On an EVDO network it takes about 10 secs for the 1MB file. At the moment sprint and verizon supports EVDO cards for laptops.


GSM 14.4 kbps
GPRS 115 kbps
CDMA 2000 144kbps
EDGE 384 kbps
w-cdma (3G) - 2000kbps - 2mb
evdo 2 - 400 kbps

Good article on EVDO

what is android.text.util and Linkify

Search for: what is android.text.util and Linkify

dalvik jvm vs java

dalvik jvm

Search for: dalvik jvm

Apache Harmony

Search for: Apache Harmony

Dalvik internals: a google presentation

hiphop jvm

Search for: hiphop jvm

What is implicit typing in dalvik vm?

Search for: What is implicit typing in dalvik vm?

What is Zygote

Search for: What is Zygote

What is mobile ARM?

Search for: What is mobile ARM?

The effort started in 2005 at google as part of the Android work. Handheld devices lack in memory and speed from a desktop version by 8 to 10 years. They have very limited power available for any intense computation. They may only have as little as 20Mb of space available for applications. The total RAM may even be as less as 64Mb. The performance requirements as a result are draconian, requiring handset designers to optimize everything. If you look at the list of packages in Android, you will know that they are full featured and extensive in number. According to google these system libraries may take as much as 10Mb with their optimized jvm.

This led to revisiting the JVM implemenation. Much of the graphics code is implemented in native c and c++ libraries. Java is a just a thin wrapper. The key figure in the googles implementation of this JVM is Dan Bornstein, who is a native of Dalvik, a town in Iceland. This is how this JVM implementation got its name.

Android takes the generated multiple class files and combines them into one or more dex files. Duplicate information from multiple class files are reused and effectively the space requirement (uncompressed) will go down by half from a traditional jar file. For example the dex file of the web browser app in Android is about 200k. The equivalent uncompressed jar version is about 500k. The alarm clock app is about 50k in dex file size and roughly double in its jar version.

Android also believed that pre loading the most used classes at boot time and then allowing them to be shared will save memory and cpu cycles. To this end they designed a pre load process called Zygote that shares the core libraries between other java processes.

Google also has tuned the garbage collection and also opted for not having a JIT, at least, in this release. The thought is that most of the core is in c and c++ which don't require JIT.

Android also uses a diffrent kind of assembly code generation where it uses registers as the primary units of data storage and not the stack. By doing this Google is hoping to accomplish 30% fewer instructions.

What is QEMU

Search for: What is QEMU

Dan Bornsteins background

Dalvik Executable

QEMU on wikipedia

This is a process emulator where one CPU can emulate another CPU. Allows writing virtual machines where one operating system can host other other operating systems written for other CPUs. For example it can run Linux binaries on most of the processors in the market including ARM.

What is ARM?

Search for: What is ARM?

This is a microprocessor architecture based on RISC (Reduced Instruction Set Computer)where design uniformity and simplicity and speed is acheived by reducing the number of instructions in an instruction set. PowerPCs supporting Apple Macs, and SPARC chips supporting Sun workstations are examples of RISC architectures. ARM (Advanced RISC machine) architecture is a 32 bit processor RISC architecture that is widely used in hand helds and other embedded electronics where lower power consumption is important. Accornding to wikipedia 75% of the mobile market uses processors based on this architecture. The Apple Newton is based on ARM6 processor. Devices like iPod, Nintendo DS, and Gameboy Advance run on ARM architectur version 4 with around 30,000 transistors. Compared to that the Pentium classic contains 3,200,000 (3.2 million) transistors. 100 times more transistors.

android emulator architecture qemu arm

Search for: android emulator architecture qemu arm

It is based on ARM v5 CPU, 16 bit LCD display, sound card, flash memory, GSM modem, and a SIM card.

Details about emulator options

support for placing and receiving calls, Capture Camera images/video, battery usage, bluetooth.

What are dalvik limitations

Search for: What are dalvik limitations

beanshell and dalvik

dalvik javase

Search for: dalvik javase

Apache Harmony

Apache Harmony Dalvik Android

Search for: Apache Harmony Dalvik Android

It is optimized to run multiple vms so that each android application runs in its own process with its own instance of dalvik VM. Dalvik is written such that these simultaneous vms can run efficiently.

Dalvik doesn't use its own compiler. It just uses any java code compiled by any java compiler. It uses the Apache implementation of the Java SE.

Java ME doesn't come packaged with OpenGL, Bluetooth,and USB support and a developer cannot assume they are there.

A limited subset of the packages are provided

swing and awt are not included.

Android comes with a subset of Java SE packages.

Read this link to see the differences in java se implementation


java.beans
java.awt
javax.swing

Problems issues with J2ME JME

Search for: Problems issues with J2ME JME

KVM and Dalvik

Search for: KVM and Dalvik

Java KVM

Search for: Java KVM

Java KVM packages

Search for: Java KVM packages

what is midp?

Search for: what is midp?

j2me faq

kvm white paper pdf

j2me positioning

In increasing complexity here is the list of jvms

java cldc - kvm - a tiny portion of java se
java cdc - a portion of java se
java se
java ee

pbp, agui, java tv

Search for: pbp, agui, java tv

midp java apis

Search for: midp java apis

java me apis

Android has taken a dedicated and focussed approach to it mobile platform efforts. The android platform comes with everything you need in a single package: the OS, device drivers, core libraries, JNI, Optimized Dalvik VM, and the Java development environment. Developers can be assured that when they develop new applications they can be certain that all key libraries are available on the device. Android has chosen not to use the Java ME standard for its mobile efforts. Android also diverged from java execution environment developing their own JVM.

Let me present very briefly how Java ME works before comparing the two approaches. Java SE, the standard edition, is suitable for desktop and workstation configurations. Java EE, the enterprise edition is designed for server configurations. In a similar sense Java ME is an edtion of Java that is pared down for smaller devices. Java ME is further broken down into two configurations. The first configuration is called the "Connected Device Configuration" or CDC. The Java ME for CDC involves a pared down version of Java SE with less number of packages, and less number of classes with in those packages and even more dramatically less number fields and methods with in those classes. For appliances and devices that are further constrained, java defines a configuration called "Connected Limited Device Configuration" that is further more constrained.

Any optional packages that are installed on top of these base CDC and CLDC apis are treated as "profiles" that are standardized using the JSR process. Each defined "profile" adds an additional set of apis to the core. Both CLDC and CDC may support some java apis that are outside of JavaSE. These classes may not start with java.* namespace. What this means is that if you have a java program that runs on your desktop, there are no guarantees that it will run on microedition versions.

The CLDC configuration includes java.lang, java.util, io, security, and internationalization. It does not include user interface, event handling, an application model. Furthermore it doesnt support floating point, JNI, reflection, and weak references. The white paper on CLDC available at http://java.sun.com/products/cldc/wp/KVMwp.pdf lists all the packages and classes that are part of the CLDC.

The CLDC java platform is hosted on a specialized and much reduced JVM called "KVM" that is capable of running on devices that have as low memory as 128 kilo bytes. The "k" in "kvm" stands for "kilobytes". CLDC provides addtional apis under the name "MIDP 2.0" (Mobile Information Device Profile). This api includes a number of packages under javax.microedition.*. The key packages are midlets (simple applications), a ui package called LCDUI, gaming and media.

The CDC configuration adds to this the "awt", "net", and more security apis. It also adds the javax.microedition.xlet api. Xlets represent applications in the CDC configuration. On top of this it has about 10 more optional packages that can be run. These include bluetooth, media api, OpenGL/ES, Jaxp, Jaxp-rpc, java 2D, Swing, RMI, JDBC, and Java API. Overall the javame specification includes over 20 JSRs. It is also expected that JavaFx will also play an increasing role in the mobile space for java.

As you can see Java ME seem to be addressing two classes of micro devices. It offers standardized and distinct solutions for each. Android on the other hand has just one model. Android stays slightly higer on the food chain by ignoring the really low end devices or hoping that the configurations of these very low end devices will improve making Android feasible even for those devices.

Android is easy to understand as it focuses all its ideas in a single model. Where as Java ME it has multiple UI models for each configuration: there are midlets, xlets, awt, and swing based on the features supported by a device.

The multiplication of JSRs for each spcification of Java ME is tedious to follow and possibly could take longer to mature and find implementations for.

The Dalvik VM is much more optimized and should be much more responsive compared to the standard JVM supported on a similarly configured device. Dalvik VM can be compared to KVM but KVM is addressing a much lower configuration devices with much less memory.

Android, due to Dalvik VM, does not run java byte codes but DEX formatted byte codes. This should not be a major concern as long as java is compiled to standard java class files. Only run time interpretation of java byte codes is not possible.

However there is wide spread support for Java ME on mobile devices as most of the mobile phones support Java ME. However the uniformity, cost, and ease of development in Android would be a compelling reason for java developers to develop on Android.

Compared to the suport for Java SE in CDC, the Android support for Java SE is better except for the awt and swing. Android has its own ui approach. The whole Android Java SDK differs signicantly from the java approach by introducing declarative UIs, Intents, and Content Providers. The declarative UI of Android is similar to the Java Fx approach.

java me

Search Google for: java me

Search Android Developers Group for: java me

Search Android Beginers Group for: java me

Search Google Code for: java me

Search Android Issues Database for: java me

Mobile Operating Systems Palm OS, Symbian

Search for: Mobile Operating Systems Palm OS, Symbian

Tmobile G1 specs memory cpu

Search for: Tmobile G1 specs memory cpu

Tmobile G1 compared to iPhone

what is skia graphics library

Search for: what is skia graphics library

more about skia

open gl es kronos

Search for: open gl es kronos

background on skia