Thought – done. Picture 2 Google DrivingDirections implementation in Android The development process of the application in the picture above took about 1½ hours! (Including the simple user interface and all images you see). Could one create such a sophisticated application on any other mobile-platform? – No.
andbook - Android Programming
11
powered by anddev.org
Additionally this application could be enriched with the current GPS-position of the device within a handful of code-lines. Google emphasizes Androids power of providing location-based-services. Google Maps are so neat within Android as if it was just developed for Android. One can integrate a fully zoom and drag enabled map by adding just 3(!) characters in the Java-Code of the Android-Default-Application and 3 lines of XML-Code. Other nice features that are easy to use with Android are Animations and media-playback. Since version m5, the Android SDK contains functions for straight and reverse GeoCoding and in addition to mp3, playback of: ogg-Vorbis, MIDI and a bunch of other formats.
andbook - Android Programming
12
powered by anddev.org
The first weeks
Unfortunately the developers had to deal with a not fully implemented preview-SDK (initially released build: ‘m3-rc20’), where even some key-parts of the SDK were poorly documented. The lack of documentation leaded to an explosion of the Android-Developer-Group within the Google-Groups. Sooner or later one had to respect the statement from Google: “If it is not documented it is not meant to work yet.“ Many developers did not realize that fact that the first SDK released were first-looks or developer-previews, where changes in the API had to be awaited. Another annoying bug was the choppy emulator-sound, which was said fixed with the release of build ‘m3-rc37a’ about 4 weeks later, but still happened on some setups up to m5.
andbook - Android Programming
13
powered by anddev.org
Dalvik.equals(Java) == false
Why “Dalvik”? – The Dalvik virtual machine was named by Bornstein after the fishing village of Dalvík in Eyjafjörður (Iceland), where some of his ancestors lived. As you may have heard of, Dalvik is the name of Android's virtual machine. It is an interpreter-only virtual machine that executes files in the Dalvik Executable (*.dex) format, a format that is optimized for efficient storage and memory-mappable execution. The virtual machine is register-based, and it can run classes compiled by a Java language compiler that have been transformed into its native format using the included "dx" tool. The VM runs on top of a Linux 2.6 kernel, which it relies on for underlying functionality (such as threading and low level memory management). The DalvikVM was also optimized to be running in multiple instances with a very low memory-footprint. Several VMs protect ones application from being dragged down by another crashed Application.
Differences to a normal JavaVM
JavaVM’s one can find on almost any desktop computer nowadays are Stack-based Virtual Machines (VM).The DalvikVM on the other hand is register based, because on mobile-processors are optimized for register-based execution. Also of register-based VMs allow faster execution times at the expense of programs which are larger after compilation.
andbook - Android Programming
14
powered by anddev.org
The Android Code Challenge
The Android Code Challenge (ADC) is an idea of Google to encourage the community to build cool applications for the Android Platform by rewarding the 50 most promising applications submitted.
Android programming
Start from the beginning
