android phone development

13
Android Phone Development Lizada, Ranier Albert A.

Upload: ranierlizada

Post on 20-Jul-2016

6 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Android Phone Development

Android Phone DevelopmentLizada, Ranier Albert A.

Page 2: Android Phone Development

Table of Contents

Introduction …………………………………………………………………………………………………… 1

History of Android …………………………………………………………………………………… 2

The Android Platform ………………………………………………………………………………… 4

Android Architecture ………………………………………………………………………………… 5

Development Tools ………………………………………………………………………………………… 8

Using Hardware Devices …………………………………………………………………………… 8

Source Codes ……………………………………………………………………………………………………… 9

o Metronome …………………………………………………………………………………………… 10

o Radar ………………………………………………………………………………………………………… 19

o Any Cut …………………………………………………………………………………………………… 34

o Downloader …………………………………………………………………………………………… 48

o Triangle ………………………………………………………………………………………………… 67

Introduction

Page 3: Android Phone Development

What is Android?

Android is an open source mobile operating system that merges

and builds upon parts of many diverse open source projects.

What does this mean to you as a developer? You have access to

the source code of the platform that is running on the phone.

This can help you better recognize how interface controls and

the different other pieces work. If you happen to come across a

bug, you can also submit a patch for the issue, though this is

a more highly developed practice.

Google has also pulled together a large group of companies

(called the Open Handset Alliance) that mutually contribute to

and use the Android OS in their hardware devices. This means

that there is industry-wide support for Google’s OS, promising

extensive acceptance across distinguished vendors.

History of Android

Page 4: Android Phone Development

October 2003 – Android, Inc. was founded in Palo Alto, California by Andy Rubin, Rich Miner, Nick Sears, and Chris White.

August 2005 – Google acquired Android, Inc. 5th of November, 2007 – The Open Handset Alliance, a

consortium of several companies, was formed 12th of November, 2007 – Android Beta SDK was released

o 0.50% Worldwide Android Market Share 23rd of September, 2008 – Android 1.0 featured in the first

Android device, the HTC Dream(G1)o Integration with Google Serviceso Web Browser to show, zoom, and pan full HTML and

XHTML web pages; Multiple pages show as windowso Android Market app downloads and updateso Multitasking, Instant Messaging, Wi-Fi, and Bluetooth

9th of February, 2009 – Android 1.1 update was released for T-Mobile G1

30th of April, 2009 – Based on Linux kernel 2.6.27, the official Android 1.5 (Cupcake) update was released

o Ability to record and watch videos through camcorder mode

o Uploading videos to YouTube and pictures to Picasa directly from the phone

o A new soft-keyboard with text-predictiono Bluetooth A2DP and AVRCP supporto Ability to automatically connect to a Bluetooth

headset within a certain distanceo New widgets and folders that can populate the Home

screenso Animated screen transitions

15th of September, 2009 - Based on Linux Kernel 2.6.29, the 1.6 (Donut) SDK was released

o Quick Search Box and Voice Searcho Integrated camera, camcorder, and gallery, toggle

between still and video capture modeso Battery usage indicatoro CDMA Supporto Multilingual text-to-speech function

26th of October, 2009 – Based on Linux Kernel 2.6.29, the 2.0 (Éclair) SDK was released

o Multiple accounts for email and contact synchronization

o Microsoft Exchange Support for syncing of emailo Bluetooth 2.1 supporto New browser User Interface and support for HTML5o New calendar featureso Improved Google Maps 3.1.2

Page 5: Android Phone Development

o Built in flash support for Camerao Digital Zoomo MotionEvent class enhanced to track multi-touch

events. 3rd of December, 2009 – 2.0.1 SDK was released

o 3.90% Worldwide Android Market Share 12th of January, 2010 – 2.1 SDK was released 20th of May, 2010 – Based on Linux Kernel 2.6.32[45], 2.2

(Froyo or Frozen Yogurt) SDK was releasedo 17.70% Worldwide Android Market Shareo Hotspot supporto Adobe Flash 10.1

6th of December, 2010 - the 2.3 (Gingerbread) SDK was released

o Support for bigger screens with up to Wide XGA (1366×768) resolution.

o Support for WebM video playback.o Near Field Communication (NFC)

22nd of February, 2011 - Based on Linux Kernel 2.6.35, 2.3.3 was released

22nd of February, 2011 - Based on Linux Kernel 2.6.36, 3.0 (Honeycomb) SDK was released for tablets

10th – 11th of May, 2011 – 4.0 (Ice Cream Sandwich) was announced at Google I/O

18th of July, 2011 – 3.2 SDK was released November or December 2011 – tentative date for the release

of Android 4.0 SDK

The Android Platform

With Android's breadth of capabilities, it would be easy to confuse it with a desktop operating system. Android is a

Page 6: Android Phone Development

layered environment built upon a foundation of the Linux kernel, and it includes rich functions. The UI subsystem includes:

Windows Views Widgets for displaying common elements such as edit boxes,

lists, and drop-down lists

Android includes an embeddable browser built upon WebKit, the same open source browser engine powering the iPhone's Mobile Safari browser.

Android boasts a healthy array of connectivity options, including WiFi, Bluetooth, and wireless data over a cellular connection (for example, GPRS, EDGE, and 3G). A popular technique in Android applications is to link to Google Maps to display an address directly within an application. Support for location-based services (such as GPS) and accelerometers is also available in the Android software stack, though not all Android devices are equipped with the required hardware. There is also camera support.

Historically, two areas where mobile applications have struggled to keep pace with their desktop counterparts are graphics/media, and data storage methods. Android addresses the graphics challenge with built-in support for 2-D and 3-D graphics, including the OpenGL library. The data-storage burden is eased because the Android platform includes the popular open source SQLite database. Figure 1 shows a simplified view of the Android software layers.

Android Architecture

Page 7: Android Phone Development

Application Framework

As mentioned, Android runs atop a Linux kernel. Android applications are written in the Java programming language, and they run within a virtual machine (VM). It's important to note that the VM is not a JVM as you might expect, but is the Dalvik Virtual Machine, an open source technology.

An Android application consists of one or more of the following classifications:

ActivitiesAn application that has a visible UI is implemented

with an activity. When a user selects an application from the home screen or application launcher, an activity is started.

Page 8: Android Phone Development

ServicesA service should be used for any application that

needs to persist for a long time, such as a network monitor or update-checking application.

Content providersYou can think of content providers as a database

server. A content provider's job is to manage access to persisted data, such as a SQLite database. If your application is very simple, you might not necessarily create a content provider.

If you're building a larger application, or one that makes data available to multiple activities or applications, a content provider is the means of accessing your data.

Broadcast receiversAn Android application may be launched to process a

element of data or respond to an event, such as the receipt of a text message.

An Android application, along with a file called AndroidManifest.xml, is deployed to a device. AndroidManifest.xml contains the necessary configuration information to properly install it to the device. It includes the required class names and types of events the application is able to process, and the required permissions the application needs to run.

Libraries

Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are listed below:

System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices

Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG

Page 9: Android Phone Development

Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications

LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view

SGL - the underlying 2D graphics engine 3D libraries - an implementation based on OpenGL ES 1.0

APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer

FreeType - bitmap and vector font rendering SQLite - a powerful and lightweight relational database

engine available to all applications

Android Runtime

Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.

Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool.

The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.

Linux Kernel

Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

Development Tools

Page 10: Android Phone Development

The chief tools for developing Android apps are designed to be used with the Eclipse Integrated Development Environment, which is a general IDE for Java applications. Eclipse is free to download, as are the tools essential to build and test Android applications. The necessary tools include the Android Software Development Kit and the Android Developer Tools. These grant everything crucial to develop Android applications, including programming, designing, compiling, testing and exporting final applications.

Using Hardware Devices

You can use whichever Android-powered device as an environment for running, debugging, and testing your applications. The tools incorporated in the SDK make it easy to install and run your application on the device each time you compile. You can install your application on the device directly from Eclipse or from the command line with ADB. If you don't yet have a device, check with the service providers in your area to determine which Android-powered devices are available.

If you want a SIM-unlocked phone, then you might consider either an Android Dev Phone or the Google Nexus S. These are SIM-unlocked so that you can use them on any GSM network using a SIM card. The Android Dev Phones also feature an unlocked bootloader so you can install custom system images (great for developing and installing custom versions of the Android platform).

References

Page 11: Android Phone Development

http://www.ibm.com/developerworks/opensource/library/os-android-

devel/#ibm-pcon

http://www.ehow.com/info_8198520_android-phone-app-

development.html

http://www.ehow.com/info_12118625_android-developer-basics.html

http://developer.android.com/guide/basics/what-is-android.html

http://mobile.tutsplus.com/tutorials/android/introduction-to-

android-development/

http://www.androidzune.com/what-is-an-android-full-android-

history-with-all-versions-details.html

http://developer.android.com/guide/developing/device.html

http://code.google.com/p/apps-for-android/