android operating system and its application development..1

Upload: aditi-chaudhary

Post on 09-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Android Operating System and Its Application Development..1

    1/76

    1

    ANDROID OPERATING SYSTEM AND ITS

    APPLICATION DEVELOPMENT

    SEMINAR REPORT

    Submitted to the faculty of Engineering

    BharatiVidyapeethUniversityCollege of Engineering, Pune

    In partial fulfillment of requirements for the degree of

    Bachelor of Engineering

    In

    Computer Engineering

    Submitted By

    MANISH CHAHAL

    ROLL NO:-61

    CLASS:-BE COMP II

    UNDER THE GUIDANCE OF:

    PROF.MILIND BHOR

    DEPARTMENT OF COMPUTER ENGINEERING

    BHARATI VIDYAPEETH UNIVERSITY COLLEGE OF ENGINEERING

    2010 - 2011

  • 8/8/2019 Android Operating System and Its Application Development..1

    2/76

    2

    DEPARTMENT OF COMPUTER ENGINEERING

    BHARATIVIDYAPEETHUNIVERSITY

    COLLEGE OF ENGINEERING

    ACADEMIC YEAR 2010-2011

    CERTIFICATE

    This is to certify that the seminar entitled ANDROID OPERATING

    SYSTEM AND ITS APPLICATIO N DEVELOP MENT has been

    successfully completed b y MANISH CHAHAL, of classB.E.

    Computer II, Roll No. 61, Department of Computer Engineering,

    BharatiVidyapeeth University, College of Engineering, under the guidance of

    Prof. MILIND BHOR in a satisfactory manner as partial fulfillment of Bachelor

    of Engineering Degree in Computer engineering during the academic year

    20102011.

    Date: 4/10/2010

    Prof. MilindBhor Prof. Suhas H. Patil

    (Seminar Guide) (H.O.D., Computer Science Dept.)

  • 8/8/2019 Android Operating System and Its Application Development..1

    3/76

    3

    ACKNOWLEDGEMENT

    Inspiration and guidance are invaluable in every aspect of life, especially in the

    fields of academics, which I have received from my respected seminar guide

    Prof. MilindBhor, who at very discrete step in study of this seminar contributed

    his valuable guidance to solve every problem that arose.

    I would also like to thank the Head of Department of Computer Engineering,

    Prof. S. H. Patil, who has given me this opportunity to present this seminar.

    Lastly I would like to thank all the staff members and my classmates who

    directly or indirectly helped me time to time.

    Manish Chahal

    B.E. Comp II

    Roll No. 61

  • 8/8/2019 Android Operating System and Its Application Development..1

    4/76

    4

    PAGE INDEX

    Topic Page

    no.

    1. INTRODUCTION1.1THE BIRTH OF ANDROID

    1.1.1 GOOGLE ACQUIRES ANDROID INC.

    1.1.2 OPEN HANDSET ALLIANCE FOUNDED

    1.1.3 HARDWARE

    1.2FEATURES1.2.1 APPLICATION FRAMEWORK

    1.2.2 DALVIK VIRTUAL MACHINE

    1.2.3 INTEGRATED BROWSER

    1.2.4 OPTIMIZED GRAPHICS

    1.2.5 SQLITE

    1.2.6 HANDSET LAYOUTS

    1.2.7 DATA STORAGE

    1.2.8 CONNECTIVITY

    1.2.9 MESSAGING

    1.2.10 WEB BROWSER

    1.2.11 JAVA VIRTUAL MACHINE

    1.2.12 MEDIA SUPPORT

    1.2.13 ADDITIONAL HARDWARE

    SUPPORT

    1.2.14 DEVELOPMENT ENVIORNMENT

    8

    9

    9

    9

    9

    10

    10

    10

    10

    11

    11

    11

    11

    12

    12

    12

    12

    12

    12

    12

  • 8/8/2019 Android Operating System and Its Application Development..1

    5/76

    5

    2. DETAILED DESCRIPTION OF TOPIC2.1OPERATION

    2.1.1 ANDROID RUNTIME

    2.1.2 LINUX KERNEL

    2.1.4 LIBRARIES

    2.1.5 ANDROID RUNTIME

    2.1.6 APPLICATION FRAMEWORK

    2.1.7 APPLICATION LAYER

    2.2DEVELOPING APPLICATIONS2.2.1 APPLICATION BUILDING

    BLOCK

    2.2.2 ANDROID MANIFEST.XML

    2.2.3 APPLICATION LIFECYCLE

    2.2.4 APPLICATION FRAMEWORK

    2.2.5 LIBRARY

    2.3SOFTWARE DEVELOPMENT2.3.1 SOFTWARE DEVELOPMENT

    KIT

    2.4SECURITY ISSUES2.5COMPARISON

    12

    12

    12

    12

    13

    14

    15

    15

    16

    16

    17

    23

    24

    24

    25

    26

    3.

    ANDROID AND ITS APPLICATIONS3.1INTRODUCTION TO ANDROID DEV3.2BEST ANDROID APPLICATIONS3.3ANDROID APPLICATION DEVELOPMENT3.4GOOGLE PROJECTS FOR ANDROID

    3434

    44

    46

    51

  • 8/8/2019 Android Operating System and Its Application Development..1

    6/76

    6

    3.5GUIDE FOR ANDROID APPLICATIONDEVELOPMENT

    3.6SETTING UP AN ENVIORONMENT FOR ANDROIDAPPLICATION DEVELOPMENT

    3.7ANDROID APPLICATION DEVELOPERIES

    52

    54

    60

    4. CONCLUSION AND FUTURE SCOPE 62

    5. REFERENCE 63

    6. EXAMPLE CODES 64

  • 8/8/2019 Android Operating System and Its Application Development..1

    7/76

    7

    Figure index

    FIGURE PAGE NO..

    1.FIGURE ABOUT ANDROID ARCHITECTURE

    122.FLOWCHART SHOWING THE LIFECYCL OF AN ACTIVITY

  • 8/8/2019 Android Operating System and Its Application Development..1

    8/76

    8

    3.FIG 2.5 19

    4.FIG 2.6 20

    5.FIG 2.7 20

    6.FIG 2.8 21

    7.FIG 2.9 21

    8.FIG 2.10 22

    9.FIG 2.11 22

    10.FIG 2.12 24

    11.FIG 2.13 27

    12 FIG 2.14 28

    13 FIG 3 41

    13 FIG 4 42

    14 FIG 5 43

    15 FIG 6 46

    .

    1.INTRODUCTIONAndroid is a software stack for mobile devices that includes an operating system, middleware

    and key applications.Android is a software platform and operating system for mobile devices

    based on the Linux operating system and developed by Google and the Open Handset

  • 8/8/2019 Android Operating System and Its Application Development..1

    9/76

    9

    Alliance. It allows developers to write managed code in a Java-like language that utilizes

    Google-developed Java libraries, but does not support programs developed in native code.

    The unveiling of the Android platform on 5 November 2007 was announced with the

    founding of the Open Handset Alliance, a consortium of 34 hardware, software and telecomcompanies devoted to advancing open standards for mobile devices. When released in 2008,

    most of the Android platform will be made available under the Apache free-software and

    open-source license.

    1.1. THE BIRTH OF ANDROID1.1.1. Google Acquires Android Inc.

    In July 2005, Google acquired Android Inc., a small startup company based in Palo

    Alto, CA. Android's co-founders who went to work at Google included Andy Rubin

    (co-founder of Danger), Rich Miner (co-founder of Wildfire Communications, Inc),

    Nick Sears (once VP at T-Mobile), and Chris White (one of the first engineers at

    WebTV). At the time, little was known about the functions of Android Inc. other than

    they made software for mobile phones.

    At Google, the team, led by Rubin, developed a Linux-based mobile device OS which

    they marketed to handset makers and carriers on the premise of providing a flexible,

    upgradeable system. It was reported that Google had already lined up a series of

    hardware component and software partners and signaled to carriers that it was open to

    various degrees of cooperation on their part.

    1.1.2. Open Handset Alliance FoundedOn 5 November 2007, the Open Handset Alliance, a consortium of several companies

    which include Google, HTC, Intel, Motorola, Qualcomm, T-Mobile, Sprint Nextel

    and NVIDIA, was unveiled with the goal to develop open standards for mobile

    devices. Along with the formation of the Open Handset Alliance, the OHA also

    unveiled their first product, Android, an open source mobile device platform based on

    the Linux operating system.

  • 8/8/2019 Android Operating System and Its Application Development..1

    10/76

    10

    1.1.3. HardwareGoogle has unveiled at least three prototypes for Android, at the Mobile World

    Congress on February 12, 2008. One prototype at the ARM booth displayed several

    basic Google applications. A 'd-pad' control zooming of items in the dock with a

    relatively quick response.

    A prototype at the Google IO conference on May 28, 2008 had a 528 MHz Qualcomm

    processor and a Synaptics capacitive touch screen, and used the UMTS cellular

    standard. It had 128 MB of RAM and 256 MB of flash, showing that Android's

    memory requirements are reasonable. The demo was carried out using a 3.6 Mbit/s

    HSDPA connection.

    1.2. FEATURES1.2.1. Application Framework

    It is used to write applications for Android. Unlike other embedded mobile

    environments, Android applications are all equal, for instance, an applications

    which come with the phone are no different than those that any developer

    writes.The framework is supported by numerous open source libraries such as

    openssl, SQLite and libc. It is also supported by the Android core libraries.

    From the point of security, the framework is based on UNIX file system

    permissions that assure applications have only those abilities that mobile phone

    owner gave them at install time.

    1.2.2. Dalvik Virtual MachineIt is extremely low-memory based virtual machine, which was designed especially for

    Android to run on embedded systems and work well in low power situations. It is

    also tuned to the CPU attributes. The Dalvik VM creates a special file format

    (.DEX) that is created through build time post processing. Conversion between

    Java classes and .DEX format is done by included dx tool.

  • 8/8/2019 Android Operating System and Its Application Development..1

    11/76

    11

    1.2.3. Integrated BrowserGoogle made a right choice on choosing WebKit as open source web browser. They

    added a two pass layout and frame flattening. Two pass layout loads a page without

    waiting for blocking elements, such as external CSS or external JavaScript andafter a while renders again with all resources downloaded to the device. Frame

    flattening converts founded frames into single one and loads into the browser.

    These features increase speed and usability browsing the internet via mobile phone.

    1.2.4. Optimized GraphicsAs Android has 2D graphics library and 3D graphics based on OpenGL ES

    1.0, possibly we will see great applications like Google Earth and spectacular

    games like Second Life, which come on Linux version. At this moment, the

    shooting legendary 3D game Doom was presented using Android on the mobile

    phone.

    1.2.5. SQLiteExtremely small (~500kb) relational database management system, which is

    integrated in Android. It is based on function calls and single file, where all

    definitions, tables and data are stored. This simple design is more than suitable for aplatform such as Android.

    1.2.6. Handset LayoutsThe platform is adaptable to both larger, VGA, 2D graphics library, 3D graphics

    library based on OpenGL ES 1.0 specifications, traditional smart phone layouts. An

    underlying 2D graphics engine is also included. Surface Manager manages access to

    the display subsystem and seamlessly composites 2D and 3D graphic layers from

    multiple applications

    1.2.7. Data StorageSQLite is used for structured data storage .SQLite is a powerful and lightweight

    relational database engine available to all applications.

  • 8/8/2019 Android Operating System and Its Application Development..1

    12/76

    12

    1.2.8. ConnectivityAndroid supports a wide variety of connectivity technologies including GSM,

    CDMA, Bluetooth, EDGE, EVDO, 3G and Wi-Fi.

    1.2.9. MessagingSMS, MMS, and XMPP are available forms of messaging including threaded text

    messaging.

    1.2.10.Web BrowserThe web browser available in Android is based on the open-source WebKit

    application framework. It includesLibWebCore which is a modern web browser

    engine which powers both the Android browser and an embeddable web view.

    1.2.11.Java Virtual MachineSoftware written in Java can be compiled into Dalvikbytecodes and executed in the

    Dalvik virtual machine, which is a specialized VM implementation designed for

    mobile device use, although not technically a standard Java Virtual Machine.

    1.2.12.Media Support

    Android will support advanced audio/video/still media formats such as MPEG-4,

    H.264, MP3, and AAC, AMR, JPEG, PNG, GIF.

    1.2.13.Additional Hardware SupportAndroid is fully capable of utilizing video/still cameras, touchscreens, GPS,

    compasses, accelerometers, and accelerated 3D graphics.

    1.2.14.Development EnvironmentIncludes a device emulator, tools for debugging, memory and performance profiling, a

    plugin for the Eclipse IDE. There are a number of hardware dependent features,

    for instance, a huge media and connections support, GPS, improved support for

    Camera and simply GSM telephony. A great work was done for the developers

  • 8/8/2019 Android Operating System and Its Application Development..1

    13/76

    13

    to start work with Android using device emulator, tools for debugging and

    plugin for Eclipse IDE.

    2.DETAILED DESCRIPTION OF THE TOPIC

    2.1. OPERATION2.1.1. Android RuntimeAndroid 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

  • 8/8/2019 Android Operating System and Its Application Development..1

    14/76

    14

    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 classescompiled 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.

    2.1.2. Linux KernelAndroid 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.

    It helps to manage security, memory management, process management, network stack

    and other important issues. Therefore, the user should bring Linux in his mobile device

    as the main operating system and install all the drivers required in order to run it.

    Developers have full access to the same framework APIs used by the core applications.

    The application architecture is designed to simplify the reuse of components; any

    application can publish its capabilities and any other application may then make use ofthose capabilities (subject to security constraints enforced by the framework). This

    same mechanism allows components to be replaced by the user. Underlying all

    applications is a set of services and systems.

    ARCHITECTURE

    The following diagram shows the major components of the Android operating system. Each

    section is described in more detail below.

  • 8/8/2019 Android Operating System and Its Application Development..1

    15/76

    15

    Figure 2.1: Architecture of Android

    2.1.3. Linux KernelAndroid Architecture is based on Linux 2.6 kernel. It helps to manage security,

    memory management, process management, network stack and other important

    issues. Therefore, the user should bring Linux in his mobile device as the main

    operating system and install all the drivers required in order to run it. Android

    provides the support for the Qualcomm MSM7K chipset family. For instance, the

    current kernel tree supports Qualcomm MSM 7200A chipsets, but in the second half

    of 2008 we should see mobile devices with stable version Qualcomm MSM 7200,

    which includes major features:

    y WCDMA/HSUPA and EGPRS network supporty Bluetooth 1.2 and Wi-Fi supporty Digital audio support for mp3 and other formatsy Support for Linux and other third-party operating systemsy Java hardware acceleration and support for Java applications

  • 8/8/2019 Android Operating System and Its Application Development..1

    16/76

    16

    y Qcamera up to 6.0 megapixelsy gpsOne solution for GPSy and lots of other.

    2.1.4. LibrariesIn the next level there are a set of native libraries written in C/C++, which are

    responsible for stable performance of various components. For example, Surface

    Manager is responsible for composing different drawing surfaces on the mobile

    screen. It manages the access for different processes to compose 2D and 3D graphic

    layers. OpenGL ES and SGL make a core of graphic libraries and are used

    accordingly for3D and 2D hardware acceleration. Moreover, it is possible to use 2D

    and 3D graphics in the same application in Android. The media framework was

    provided by PacketVideo, one of the members of OHA. It gives libraries for a

    playback and recording support for all the major media and static image files.

    FreeType libraries are used to render all the bitmap and vector fonts. For data storage,

    Android uses SQLite. As mentioned before, it is extra light rational management

    system, which locates a single file for all operations related to database. WebKit, the

    same browser used by Apples Safari, was modified by Android in order to fit better

    in a small size screens.

    2.1.5. Android RuntimeAt the same level there is Android Runtime, where the main component Dalvik

    Virtual Machine is located. It was designed specifically for Android running in

    limited environment, where the limited battery, CPU, memory and data storage are

    the main issues. Android gives an integrated tool dx, which converts generated byte

    code from .jar to .dex file, after this byte code becomes much more efficient to run on

    the small processors.

  • 8/8/2019 Android Operating System and Its Application Development..1

    17/76

    17

    Figure 2.2: Conversion from .java to .dex file

    As the result, it is possible to have multiple instances of Dalvik virtual machine

    running on the single device at the same time. The Core libraries are written in Java

    language and contains of the collection classes, the utilities, IO and other tools.

    2.1.6. Application FrameworkAfter that, there is Application Framework, written in Java language. It is a toolkit

    that all applications use, ones which come with mobile device like Contacts or SMS

    box, or applications written by Google and any Android developer. It has several

    components.

    The Activity Manager manages the life circle of the applications and provides a

    common navigation back stack for applications, which are running in different

    processes. The Package Manager keeps track of the applications, which are installed

    in the device. The Windows Manager is Java programming language abstraction on

    the top of lower level services that are provided by the Surface Manager.

    The Telephony Manager contains of a set of API necessary for calling applications.

    Content Providers was built for Android to share a data with other applications, for

    instance, the contacts of people in the address book can be used in other applicationstoo. The Resource Manager is used to store localized strings, bitmaps, layout file

    descriptions and other external parts of the application. The View System generates a

    set of buttons and lists used in UI. Other components like Notification manager is

    used to customize display alerts and other functions.

  • 8/8/2019 Android Operating System and Its Application Development..1

    18/76

    18

    2.1.7. Application LayerAt the top of Android Architecture we have all the applications, which are used by the

    final user. By installing different applications, the user can turn his mobile phone into

    the unique, optimized and smart mobile phone. All applications are written using theJava programming language.

    2.2. DEVELOPING APPLICATIONS2.2.1. ApplicationBuilding Blocks

    We can think of an Android application as a collection of components, of various

    kinds. These components are for the most part quite loosely coupled, to the degree

    where you can accurately describe them as a federation of components rather than a

    single cohesive application.

    Generally, these components all run in the same system process. It's possible (and

    quite common) to create multiple threads within that process, and it's also possible to

    create completely separate child processes if you need to. Such cases are uncommon,

    because Android tries very hard to make processes transparent to your code.

    Google provides three versions of SDK for Windows, for Mac OSX and one for

    Linux. The developer can use Android plugin for Eclipse IDE or other IDEs such as

    intelliJ. First step for Android developer is to decompose the application into the

    components, supported by the platform. The major building blocks are these:

    y Activityy Intent Receivery Servicey Content Provider

    Activity

    User interface component, which corresponds to one screen at time. It means that

    for the simple application like Address Book, the developer should have one

  • 8/8/2019 Android Operating System and Its Application Development..1

    19/76

    19

    activity for displaying contacts, another activity component for displaying more

    detailed information of chosen name and etc.

    Intent Receiver

    Wakes up a predefined action through the external event. For example, for the

    application like Email Inbox, the developer should have intent receiver and

    register his code through XML to wake up an alarm notification, when the user

    receives email.

    Service

    A task, which is done in the background. It means that the user can start an

    application from the activity window and keep the service work, while browsing

    other applications. For instance, he can browse Google Maps application while

    holding a call or listening music while browsing other applications.

    Content Provider

    A component,which allows sharing some of the data with other processes and

    applications. It is the best way to communicate the applications between each

    other.Android will ship with a set of core applications including an email client,

    SMS program, calendar, maps, browser, contacts, and others. All applications are

    written using the Java programming language.

    2.2.2. AndroidManifest.xmlThe AndroidManifest.xml file is the control file that tells the system what to do with

    all the top-level components (specifically activities, services, intent receivers, and

    content providers described below) you've created. For instance, this is the "glue" that

    actually specifies which Intents your Activities receive.

    A developer should predefine and list all components, which he wants to use in the

    specific AndroidManifest.xml file. It is a required file for all the applications and is

  • 8/8/2019 Android Operating System and Its Application Development..1

    20/76

    20

    located in the root folder. It is possible to specify all global values for the package, all

    the components and its classes used, intent filters, which describe where and when the

    certain activity should start, permissions and instrumentation like security control

    and testing.

    Here is an example of AndroidManifest.xml file:

    1. 2. 4. 5. 6. 7. 8. 9. 10.11.12.

    The line 2 is a namespace declaration, which makes a standard Android

    attributes available for that application. In the line 4 there is a single

    element, where the developer specifies all application level components and its

    properties used by the package. Activity class in the line 5 represents the initial

    screen the user sees and it may have one or more elements to describe

    the actions that activity supports.

    2.2.3. Application LifecycleIn Android, every application runs in its own process, which gives better performance

    in security, protected memory and other benefits. Therefore, Android is responsible to

    run and shut down correctly these processes when it is needed.

    It is important that application developers understand how different application

    components (in particular Activity, Service, and BroadcastReceiver) impact the

  • 8/8/2019 Android Operating System and Its Application Development..1

    21/76

    21

    lifetime of the application's process. Not using these components correctly can result

    in the system killing the application's process while it is doing important work.

    To determine which processes should be killed when low on memory, Android places

    each process into an "importance hierarchy" based on the components running in

    them and the state of those components. These process types are (in order of

    importance).

    1. A foreground process is one that is required for what the user is currently doing.Various application components can cause its containing process to be considered

    foreground in different ways. A process is considered to be in the foreground if

    any of the following conditions hold:

    i. It is running an Activity at the top of the screen that the user isinteracting with (its onResume() method has been called).

    ii. It has a BroadcastReceiver that is currently running (itsBroadcastReceiver.onReceive() method is executing).

    iii. It has a Service that is currently executing code in one of its callbacks(Service.onCreate(), Service.onStart(), or Service.onDestroy()).

    There will only ever be a few such processes in the system, and these will only be

    killed as a last resort if memory is so low that not even these processes can

    continue to run. Generally, at this point, the device has reached a memory paging

    state, so this action is required in order to keep the user interface responsive.

    2. A visible process is one holding an Activity that is visible to the user on-screenbut not in the foreground (its onPause() method has been called). This may occur,

    for example, if the foreground Activity is displayed as a dialog that allows the

    previous Activity to be seen behind it. Such a process is considered extremely

    important and will not be killed unless doing so is required to keep all foreground

    processes running.

    3. A service process is one holding a Service that has been started with thestartService() method. Though these processes are not directly visible to the user,

    they are generally doing things that the user cares about (such as background mp3

    playback or background network data upload or download), so the system will

    always keep such processes running unless there is not enough memory to retain

    all foreground and visible process.

  • 8/8/2019 Android Operating System and Its Application Development..1

    22/76

    22

    4. A background process is one holding an Activity that is not currently visible to theuser (its onStop() method has been called). These processes have no direct impact

    on the user experience. Provided they implement their Activity life-cycle correctly

    (see Activity for more details), the system can kill such processes at any time to

    reclaim memory for one of the three previous processes types. Usually there are

    many of these processes running, so they are kept in an LRU list to ensure the

    process that was most recently seen by the user is the last to be killed when

    running low on memory.

    5. An empty process is one that doesn't hold any active application components. Theonly reason to keep such a process around is as a cache to improve startup time

    the next time a component of its application needs to run. As such, the system will

    often kill these processes in order to balance overall system resources between

    these empty cached processes and the underlying kernel caches

  • 8/8/2019 Android Operating System and Its Application Development..1

    23/76

    23

    Figure 2.3 :Flowchart Showing The Lifecycle Of An Activity

    In the following example we will display a process flow from the Android System point of

    View to get a clear idea how the applications behave. Let assume the

  • 8/8/2019 Android Operating System and Its Application Development..1

    24/76

    24

    Figure 2.4

    Possible scenario: A user talks to his friend via mobile phone and he is asked to browse the

    internet (a talk is hold for a moment), find a picture of him in his Picasa Album, send it via

    Email back to his friend and resume a talk.

    In this situation, there are 4 different applications and 4 different processes running, but from

    the user point of view none of them are important, as Android manages CPU work and

    memory usage by itself. It means the user can travel through the applications forward and

    back without thinking about how much memory is left or which processes are run at the time.

    Firstly, as the user is talking to his friend, a specific Talk application is opened, which

    contains the activity manager. In the following stack we can see two processes running, the

    main system process and Talk application process. Moreover, before going to Web Browser

    application, the system saves a Talk state T in order to remember that process:

    Figure 2.5

    At this point, as a user holds a talk and opens a web browser, the system creates a new

    process and new web browser activity is launched in it. Again, the state of the last activity is

    saved (W):

  • 8/8/2019 Android Operating System and Its Application Development..1

    25/76

    25

    Figure 2.6

    After that, the user browses the internet, finds his picture in Picasa album and saves it to

    particular folder. He does not close a web browser, instead he opens a folder to find saved

    picture. The folder activity is launched in particular process:

    Figure 2.7

    At this point, the user finds his saved picture in the folder and he creates a request to open an

    Email application. The last state F is saved. Now assume that the mobile phone is out of the

    memory and there is no room to create a new process for Email application. Therefore,

    Android looks to kill a process. It can not destroy Folder process, as it was used previously

    and could be reused again, so it kills Web Browser process as it is not useful anymore and

    locates a new Email process instead:

    Figure 2.8

  • 8/8/2019 Android Operating System and Its Application Development..1

    26/76

    26

    The user opens Email application and sends a picture to his friend via email. Now he wants to

    go back to the Talk application and to resume a talk to his friend. Because of the previously

    saved states, this work is done fast and easily. In this example, Email application is popped

    out and the user sees a previous Folder application:

    Figure 2.9

    Next, the user goes back to Web Browser application. Unfortunately, web browser process

    was killed previously so the system has to kill another process (in our case it is Email

    application process, which is not used anymore) in order to locate Web Browser process and

    manage the stack memory:

    Figure 2.10

  • 8/8/2019 Android Operating System and Its Application Development..1

    27/76

    27

    and finally:

    Figure 2.11

    Now the user comes back to the Talk application and resumes his talk with his friend.

    Because of the saved states, going back procedure is fast and useful, because it remembers

    previous activities and its views.

    This example shows, that it does not matter how many applications and processes are active

    or how much available memory is left, Android it manages fast and without a user

    interaction.

    2.2.4. Application FrameworkDevelopers have full access to the same framework APIs used by the core

    applications. The application architecture is designed to simplify the reuse of

    components; any application can publish its capabilities and any other application

    may then make use of those capabilities (subject to security constraints enforced bythe framework). This same mechanism allows components to be replaced by the user.

    Underlying all applications is a set of services and systems, including:

    1. A rich and extensible set of Views that can be used to build an application,including lists, grids, text boxes, buttons, and even an embeddable web browser

  • 8/8/2019 Android Operating System and Its Application Development..1

    28/76

    28

    2. Content Providers that enable applications to access data from other applications(such as Contacts), or to share their own data

    3. A Resource Manager, providing access to non-code resources such as localizedstrings, graphics, and layout files

    4. A Notification Manager that enables all applications to display custom alerts inthe status bar

    5. An Activity Manager that manages the life cycle of applications and provides acommon navigation backstack.

    2.2.5. Libraryy 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:

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

    y Media Libraries - based on PacketVideo'sOpenCORE; the libraries supportplayback 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

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

    applications.

    y LibWebCore - a modern web browser engine which powers both theAndroid browser and an embeddable web view

    y SGL - the underlying 2D graphics enginey 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

    y FreeType - bitmap and vector font rendering

  • 8/8/2019 Android Operating System and Its Application Development..1

    29/76

    29

    y SQLite - a powerful and lightweight relational database engine available toall applications.

    2.3. SOFTWARE DEVELOPMENTThe feedback on developing applications for the Android platform has been mixed.

    Issues cited include bugs, lack of documentation, inadequate QA .The first publicly

    available application was the Snake game.

    2.3.1. Software Development kitIt includes development and debugging tools, a set of libraries, a device emulator,

    documentation, sample projects, tutorials, and FAQs. Requirements also include Java

    Development Kit, Apache Ant, and Python 2.2 or later. The only officially supported

    integrated development environment (IDE) is Eclipse 3.2 or later, through the

    Android Development Tools Plugin, but programmers can use command line tools to

    create, build and debug Android applications.

    Partial Listing of Open Handset Alliance ParticipantsTechnology Vendors

  • 8/8/2019 Android Operating System and Its Application Development..1

    30/76

    30

    Figure 2.12

    2.4 SECURITY ISSUES

    Android mobile phone platform is going to be more secure than Apples iPhone or any

    other device in the long run. There are several solutions nowadays to protect Google

    phone from various attacks. One of them is security vendor McAfee, a member of Linux

    Mobile (LiMo) Foundation. This foundation joins particular companies to develop an

    open mobile-device software platform. Many of the companies listed in the LiMo

    Foundation have also become members of the Open Handset Alliance (OHA).

    As a result, Linux secure coding practice should successfully be built into the Android

    development process. However, open platform has its own disadvantages, such as source

    code vulnerability for black-hat hackers. In parallel with great opportunities for mobile

    application developers, there is an expectation for exploitation and harm. Stealthy Trojans

    hidden in animated images, particular viruses passed from friend to friend, used for

    spying and identity theft, all these threats will be active for a long run.

    Another solution for such attacks is SMobile Systems mobile package. Security Shield

    an integrated application that includes anti-virus, anti-spam, firewall and other mobile

    protection is up and ready to run on the Android operating system. Currently, the main

    problem is availability for viruses to pose as an application and do things like dial phone

    numbers, send text messages or multi-media messages or make connections to the

    Internet during normal device use. It is possible for somebody to use the GPS feature to

    track a persons location without their knowledge. Hence SMobile Systems is ready to

    notify and block these secure alerts. But the truth is that it is not possible to secure your

    mobile device or personal computer completely, as it connects to the internet. And neither

    the Android phone nor other devices will prove to be the exception.

    2.4. COMPARISON2.4.1. Speculations With Cellular Carriers

  • 8/8/2019 Android Operating System and Its Application Development..1

    31/76

    31

    Google Android enters a tangled mess of cellular carrier world. As a new player in the

    mobile market, Android brings an open platform with the new rules. On the one hand

    there is OHA with major companies and carries, such as T-Mobile and Sprint. On the

    other hand, there are two largest cellular carries AT&T and Verizon Wireless in

    United States, which have a vested interest in operating systems of their own. It is

    predictable, that Sprint or T-Mobile will be first carriers providing devices with

    Google Android. This ensures equal development time for the networks, GSM side

    and CDMA. But the main problem, which faces all the cellular carriers around the

    world, is the availability to download and use free applications that could block

    almost every communications product they sell. A user does not need to pay for GPS

    mapping service anymore. He can simply download a free one that taps into Google

    Maps.

    In fact, why pay for cellular minutes at all when a user can download Skype, Gtalk or

    other client and just use his data plan? OSs such as Android threaten carriers with a

    loss of control over the applications on the phones on their network and they may find

    themselves becoming nothing more than wireless Internet service providers, forced to

    compete on price and bandwidth.

    Another aspect is hardware cost: Google Android owns 10 percent of the total cost of

    a phone, which combined with falling hardware prices could eventually result a fertile

    unlocked handset market. In conclusion, Google has a better start in this race than any

    company had before to bring new rules to the mobile market with all carriers, mobile

    devices and its customers.

    2.4.2. Manufacturers WarPresently, Google main competitors like Nokia, Microsoft and Apple do not see

    Google Android as a serious rival or threat to their business strategies. However, the

    current situation is not so unsophisticated. There is a huge flurry in the companies,

    which are not in the list of OHA.

    For instance, Nokia, which is the largest handset manufacturer in the world, nowadays

    owning some 39% market share, was one of the companies snubbed on the invitation

    list to the 34-party Open Handset Alliance that is growing daily.

  • 8/8/2019 Android Operating System and Its Application Development..1

    32/76

    32

    In contrast, Nokia is buying companies and dumping cash into development, while

    Google is releasing an open platform hoping the applications and services will build

    themselves with the help of a strong developer community, development contests and

    large alliance of grand companies.

    Despite of this, Nokia is ready to combat whatever Google has to throw with Google

    Android in 2008. Another company Apple has already stroked the market with iPhone

    and its closed operating system. Accordingly, iPhone in the US remains loyal to

    AT&T mobile carrier for five years.

    That is plenty of time for Google to conquer the market with open Android. Obvious

    advantage of Android is cost: while iPhone is priced at a weighty $400, Google says it

    hopes to reach a more mainstream market by pricing Android-powered devices at

    around $200. Microsoft, selling 21 millions copies of Windows Mobile software,

    stays calm at this point, waiting for some particular results from Google Android.

    This nice and healthy competition is just what the mobile industry needs at the

    moment, at least for the consumers. The wars being waged between Google and the

    field will only create better, cheaper handsets and more advanced applications.

    2.4.3.

    Market Research

    A new generation of mobile device users is coming in the next decade. These users

    are going to explore the mobile internet afresh with its new features, compatible

    mobile phones, new services and applications.

    This is a huge leap for mobile advertisement business, where revenue could rise 8

    times more by 2012. Google Android is going to present new solutions through the

    fast search engine, open source applications and other services.

    The Kelsey Group, which works with public opinion polls and statistics, published the

    results released October 11 2007, which say, that one hundred out of 500, or 20

    percent of people would be interested in purchasing a Google phone. Despite the fact,

    that Google Android is in alpha version and it is unknown for the customers and

    mobile market, the results look promising.

  • 8/8/2019 Android Operating System and Its Application Development..1

    33/76

    33

    The diagram below shows the study, which was conducted in September 2007 via an

    online 30-question survey of 500 U.S. mobile phone users aged 18 and older. People

    do not find a good Internet experience in their phones today, so they are more

    interested in gravitating toward an Internet or technology company telephone

    Figure 2.13

    Because they think connectivity between devices and to the Internet is going to be

    much better on those phones. They use Google search, GMail, Google Maps, Picasa

    albums and other popular services on their computers, and this is what they expect to

    have in their mobile devices in the close future.

    2.4.4. Mobile AdsJaiku- an activity stream and sharing service that works from the Web and mobile

    phones was bought by Google as important investment into the mobile advertisement.

    People wondered why Google preferred the micro-blogging service to Twitter, which

    is much more popular nowadays.

    The answer lies in Jaikus unique ability to combine micro-blogging with users

    location. An integral part of the service is a Jaiku client application for Symbian S60

    platform mobile phones, which should come to Android platform as well. The client

    uses location APIs within device to get the handset and the users location based on

    nearby cellular network towers.

  • 8/8/2019 Android Operating System and Its Application Development..1

    34/76

    34

    Though the location is not very precise, the mobile phone is able to broadcast it

    automatically. At that point the text can be connected to users location and create a

    list of preferences for each place the user frequently visits.

    Using such a technology, it is simple to track down a user via phones IP address,

    whenever he comes into McDonald or is sitting in the airport. Google is not a million

    miles away from being able to push advanced advertising to individuals based on their

    profile, their location and their availability. They already offer regional and local

    targeting for ads for desktop users, but this could be much more useful for a mobile

    phone. And if the ads are truly relevant, interesting and unobtrusive, people might

    actually start to like them.

    2.4.5. Mobile ServicesAdding to its fast growing suite of mobile applications and services, Google has

    applied for a patent for a mobile payments service that would allow users to make

    payments at retail shops using their mobile phones. The Text Message Payment patent

    describes a system where Google offers mobile focused payments called GPay. This

    describes a system where a SMS message would be sent containing a payment

    amount and other information. That payment amount would then be validated, debited

    from the user's account, and communicated from server to server. Payment

    confirmation that had been received would also simultaneously be sent to the relevant

    party, as illustrated in the diagram below:

  • 8/8/2019 Android Operating System and Its Application Development..1

    35/76

    35

    Figure 2.14 :Figure describes Googles mobile focused payments called GPay

    Described as "a computer-implemented method of effectuating an electronic on-line

    payment," the system mentioned in the patent application is similar to existing mobile

    payment services.

    These services like mobile version of PayPal have been available for some time buthave had little success bursting with merchants and with customers. The main

    difference between existing mobile payment systems and GPay is, of course, that

    GPay is created by Google and will be easily adopted by Android Platform. The more

    issues regarding Gpay are yet to be released.

    2.4.6. What makes Android special?There are already many mobile platforms on the market today, including Symbian,

    iPhone, Windows Mobile, BlackBerry, Java Mobile Edi-tion, Linux Mobile (LiMo),

    and more. While some of its features have appeared before, Android is the rst

    environment that combines:

  • 8/8/2019 Android Operating System and Its Application Development..1

    36/76

    36

    y A truly open, free development platform based on Linux and opensource. Handset makers like it because they can use and customize the

    platform without paying a royalty. Developers like it because they

    know that the platform has legs and is not locked into any one

    vendor that may go under or be acquired.

    y A component-based architecture inspired by Internet mash-ups. Partsof one application can be used in another in ways not originally

    envisioned by the developer. You can even replace built-in

    components with your own improved versions. This will unleash a new

    round of creativity in the mobile space.

    y Tons of built-in services out of the box. Location based services useGPS or cell tower triangulation to let you customize the user

    experience depending on where they are. A full-powered SQL database

    lets you harness the power of local storage for occasionally connected

    computing and synchronization. Browser and Map views can be

    embedded directly in your applications. All these built-in capabilities

    help to raise the bar on functionality while lowering your development

    costs.

    y Automatic management of the application life cycle. Programs areisolated from each other by multiple layers of security, which will

    provide a level of system stability not seen before in smart phones. The

    end user will no longer have to worry about what applications are

    active, or close some programs so that others can run. Android is

    optimized for low-power, low-memory devices in a fundamental way

    that no previous platform has attempted.

    y High quality graphics and sound. Smooth, anti-aliased 2D vectorgraphics and animation inspired by Flash is melded with 3D

    accelerated OpenGL graphics to enable new kinds of games and

    business applications. Codecs for the most common industry standard

    audio and video formats are built right in, including H.264 (AVC),

    MP3, and AAC.

  • 8/8/2019 Android Operating System and Its Application Development..1

    37/76

    37

    y Portability across a wide range of current and future hardware. Allyour programs are written in Java and executed by Androids Dalvik

    virtual machine so your code will be portable across ARM, x86, and

    other architectures. Support for a variety of input methods is included

    such as keyboard, touch, tilt, camera, voice, and trackball. User

    interfaces can be customized for any screen resolution and orientation.

    Android is a fresh take on the way mobile applications interact with

    users, along with the technical underpinnings to make it possible. But

    the best part of Android is the software that you are going to write for

    it. This book will help you get off to a great start.

    2.4.7. Android And Java MEJava Platform, Micro Edition or Java ME (previously known as Java 2 Platform,

    Micro Edition or J2ME) is a specification of a subset of the Java platform aimed

    at providing a certified collection of Java APIs for the development of

    software for small, resource-constrained devices. Though, do not confuse it with

    Google Android, even there are some similarities:

    y Eclipse plug-ins for J2ME and Android look very similar and interface verywell with their respective SDKs;

    y Both J2ME and Android seem to share the same core Java APIs, such as java.util and java.net. But their APIs for graphics, UIs, etc. are very

    dissimilar and philosophies for developing applications are very different;

    y Android seems to be more tightly integrated (up to even the OS services provided and how they interact with the APIs), while J2ME is far more

    liberal in its specifications for the developer and mobile device manufacturer.

    A slower application development and performance these are the main

    disadvantages Java's J2ME have for today. J2ME apps are second-rate citizens in the

    phones. They do not have an access to most of the low-level features, like call API,

    external connectivity (USB) and other. There is no way to replace or extend built-in

    phone apps like contacts, calendar and calls.

  • 8/8/2019 Android Operating System and Its Application Development..1

    38/76

    38

    For instance, J2ME applications in Nokia devices with S60 work great for standard

    tasks. But more advanced users find difficulties handling Wi-Fi access points with

    S60, because APIs simply do not seem to be exposed to J2ME. A user may

    find difficulties synchronizing Google Calendar with his device - nobody seems to

    have been able to figure out how to make the J2ME calendar interfaces work

    correctly on S60. There are lots of problems with Java applications on S60, even

    though S60 probably has one of the best Java implementations.

    Android fills a void in Java Mobile applications by providing API to build richer

    applications - more useful for Smart Phones which contain the ability to provide these

    types of functionalities. If J2ME filled every void, Android as an API wouldn't be

    needed (though Android as an OS could still fill a void).

    Google has written its own virtual machine for Android most likely as a way to get

    around licensing issues with Sun. However, Android does not include a complete and

    compliant Java stack (neither JME nor JSE); only a subset and therefore it is

    technically not the Java platform, it just looks a lot like it.

    2.4.8. Openness Of The PlatformThe open source school of thought implies that differentiation and competitive

    advantage come from innovation on top of the underlying platform rather than the platform itself. The robustness and scalability of the platform is secured by the

    communitys stewardship, and open access to a central repository of updated code.

    Beyond this, a strong third-party development environment and software development

    kit (SDK) are critical to attracting innovation.

    Open is an invariably subjective term. Symbian and Microsoft can claim a degree of

    openness for their mobile platforms, for example, but ultimate control of API access

    and source code remains with a single entity. On the contrary, as Google has pointed

    out, theres nothing keeping any of the alliance members from using Android to build

    a Yahoo! Go phone.

    Motorola has had some success delivering high-volume Linux-based devices such as

    the Ming and RAZR II to market. But mobile Linux initiatives have failed to scale on

  • 8/8/2019 Android Operating System and Its Application Development..1

    39/76

    39

    the basis of attractiveness to third-party developers; its been supply-push with the

    development focus in Java ME or other application framework components.

    Importantly, Android includes almost the entirety of the applications-related software

    stack, less key technical pieces such as telephony protocol stacks, which are left to

    silicon vendors. Android bundles critical components such as a Linux kernel from

    Wind River, various optimized graphics engines, codecs, notification software, a

    clean room JVM implementation, and the KHTML open source browser. The latter

    forms the basis of Apples Safari and Nokias S60 offerings.

    2.4.9. Advantagesy Open - Android allows you to access core mobile device functionality through

    standard API calls.

    y All applications are equal - Android does not differentiate between the phone's basic and third-party applications -- even the dialer or home screen can be

    replaced.

    y Breaking down boundaries - Combine information from the web with data on thephone -- such as contacts or geographic location -- to create new user experiences.

    y Fast and easy development - The SDK contains what you need to build and runAndroid applications, including a true device emulator and advanced debugging

    tools.

    2.4.10.Disadvantagesy Security - Making source code available to everyone inevitably invites the

    attention of black hat hackers.

    y Open Source - A disadvantage of open-source development is that anyone canscrutinize the source code to find vulnerabilities and write exploits.

    y gin - Platform doesn't run on an encrypted file system and has a vulnerable log-in.

  • 8/8/2019 Android Operating System and Its Application Development..1

    40/76

    40

    y Incompetence - Googles dependence on hardware and carrier partners puts thefinal product out of their control.

    ANDROID AND ITS APPLICATION DEVELOPMENT

  • 8/8/2019 Android Operating System and Its Application Development..1

    41/76

    41

    3.Introduction to Android development

    3.1INTRODUCTION

    The BlackBerry and iPhone, which have appealing and high-volume mobile platforms, are

    addressing opposite ends of a spectrum. The BlackBerry is rock-solid for the enterprise

    business user. For a consumer device, it's hard to compete with the iPhone for ease of use and

    the "cool factor." Android, a young and yet-unproven platform, has the potential to play at

    both ends of the mobile-phone spectrum and perhaps even bridge the gulf between work and

    play.

    Today, many network-based or network-capable appliances run a flavor of the Linux kernel.

    It's a solid platform: cost-effective to deploy and support and readily accepted as a good

    design approach for deployment. The UI for such devices is often HTML-based and viewable

    with a PC or Mac browser. But not every appliance needs to be controlled by a general

    computing device. Consider a conventional appliance, such as a stove, microwave or bread

    maker. What if your household appliances were controlled by Android and boasted a color

    touch screen? With an Android UI on the stove-top, the author might even be able to cook

    something.

    In this article, learn about the Android platform and how it can be used for mobile and

    nonmobile applications. Install the Android SDK and build a simple application.

    3.1.2 The Android platform

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

    operating system. Android is a layered environment built upon a foundation of the Linux

    kernel, and it includes rich functions. The UI subsystem includes:

  • 8/8/2019 Android Operating System and Its Application Development..1

    42/76

    42

    y Windowsy Viewsy 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.

    3.1.3 Required tools

    The easiest way to start developing Android applications is to download the Android SDK

    and the Eclipse IDE . Android development can take place on Microsoft Windows, Mac

    OS X, or Linux.

    This article assumes you are using the Eclipse IDE and the Android Developer Tools plug-in

    for Eclipse. Android applications are written in the Java language, but compiled and executed

    in the Dalvik VM (a non-Java virtual machine). Coding in the Java language within Eclipse is

    very intuitive; Eclipse provides a rich Java environment, including context-sensitive help and

    code suggestion hints. Once your Java code is compiled cleanly, the Android Developer

  • 8/8/2019 Android Operating System and Its Application Development..1

    43/76

    43

    Tools make sure the application is packaged properly, including the AndroidManifest.xml

    file.

    It's possible to develop Android applications without Eclipse and the Android Developer

    Tools plug-in, but you would need to know your way around the Android SDK.

    The Android SDK is distributed as a ZIP file that unpacks to a directory on your hard drive.

    Since there have been several SDK updates, it is recommended that you keep your

    development environment well organized so you can easily switch between SDK

    installations. The SDK includes:

    ANDROID.JAR

    Java archive file containing all of the Android SDK classes necessary to build your

    application.

    DOCUMENTION.HTML AND DOCS DIRECTORY

    The SDK documentation is provided locally and on the Web. It's largely in the form

    of JavaDocs, making it easy to navigate the many packages in the SDK. The

    documentation also includes a high-level Development Guide and links to the broader

    Android community.

    SAMPLES DIRECTORY

    The samples subdirectory contains full source code for a variety of applications,

    including ApiDemo, which exercises many APIs. The sample application is a great

    place to explore when starting Android application development.

    TOOLS DIRECTORY

    Contains all of the command-line tools to build Android applications. The most

    commonly employed and useful tool is the adb utility (Android Debug Bridge).

    USB_DRIVER

    Directory containing the necessary drivers to connect the development environment to

    an Android-enabled device, such as the G1 or the Android Dev 1 unlocked

    development phone. These files are only required for developers using the Windows

    platform.

    Android applications may be run on a real device or on the Android Emulator, which ships

    with the Android SDK. Figure 3 shows the Android Emulator's home screen.

  • 8/8/2019 Android Operating System and Its Application Development..1

    44/76

    44

    Figure 3. Android Emulator

    AndroidDebugBridge

    The adb utility supports several optional command-line arguments that provide powerful

    features, such as copying files to and from the device. The shell command-line argument lets

  • 8/8/2019 Android Operating System and Its Application Development..1

    45/76

    45

    you connect to the phone itself and issue rudimentary shell commands. Figure 4 shows the

    adb shell command against a real device connected to a Windows laptop with a USB cable.

    Figure 4. Using theadb

    shell command

    Within this shell environment, you can:

    y Display the network configuration that shows multiple network connections. Note themultiple network connections:

    o lo is the local or loopback connection.o tiwlan0 is the WiFi connection with an address provisioned by a local DHCP

    server.

    yDisplay the contents of the

    PATHenvironment variable.

    y Execute the su command to become the super-user.y Change the directory to /data/app, where user applications are stored.y Do a directory listing where you see a single application. Android application files are

    actually archive files that are viewable with WinZip or equivalent. The extension is

    apk.

  • 8/8/2019 Android Operating System and Its Application Development..1

    46/76

    46

    y Issue a ping command to see if Google.com is available.

    From this same command-prompt environment, you can also interact with SQLite databases,

    start programs, and many other system-level tasks. This is fairly remarkable function,

    considering you're connected to a telephone.

    .

    3.1.4 CODING A BASIC APPLICATION

    This section provides a whirlwind tour of building an Android application. The example

    application is about as simple as you can imagine: a modified "Hello Android" application.You'll add a minor modification to make the screen background color all white so you can

    use the phone as a flashlight. Not very original, but it will be useful as an example..

    To create an application in Eclipse, select File > New > Android project, which starts the

    New Android Project wizard.

  • 8/8/2019 Android Operating System and Its Application Development..1

    47/76

    47

    Figure 5. New Android project wizard

    Next, you create a simple application with a single activity, along with a UI layout stored in

    main.xml. The layout contains a text element you're going to modify to say Android

    FlashLight. The simple layout is shown below.

    Listing 1. Flashlight layout

  • 8/8/2019 Android Operating System and Its Application Development..1

    48/76

    48

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    android:text="@string/hello" android:textColor="@color/all_black"

    android:gravity="center_horizontal"/>

    Create a couple of color resources in strings.xml.

    Listing 2. Color in strings.xml

    Android FlashLight

    FlashLight

    #FFFFFF

    #000000

    The main screen layout has a background color defined as all_white. In the strings.xml file,

    you see that all_white is defined as an RGB triplet value of #FFFFFF, or all white.

    The layout contains a single TextView, which is really just a piece of static text; it is not

    editable. The text is set to be black and is centered horizontally with the gravity attribute.

    The application has a Java source file called FlashLight.java, as shown below.

    Listing 3. Flashlight.java

    package com.msi.flashlight;

    import android.app.Activity;

    import android.os.Bundle;

    public class FlashLight extends Activity {

    /** Called when the activity is first created. */

    public void onCreate(Bundle savedInstanceState) {

  • 8/8/2019 Android Operating System and Its Application Development..1

    49/76

    49

    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    }

    }

    The code is boiler-plate directly from the New Project wizard:

    y It is part of a Java package called com.msi.flashlight.y It has two imports:

    o One for the activity classo One for the bundle class

    y When this activity is initiated, the onCreate method is invoked, passing in asavedInstanceState. Don't be concerned with this bundle for our purposes; it is used whenan activity is suspended and then resumed.

    y The onCreate method is an override of the activity class method of the same name. Itcalls the super class's onCreate method.

    y A call to setContentView() associates the UI layout defined in the file main.xml.Anything in main.xml and strings.xml gets automatically mapped to constants defined

    in the R.java source file. Never edit this file directly, as it is changed upon every

    build.

    Running the application presents a white screen with black text.

  • 8/8/2019 Android Operating System and Its Application Development..1

    50/76

    50

    Figure 6. White screen of flashlight

    The AndroidManifest.xml file setup for the FlashLight application is shown below.

    Listing 4. AndroidManifest.xml for FlashLight

  • 8/8/2019 Android Operating System and Its Application Development..1

    51/76

    51

  • 8/8/2019 Android Operating System and Its Application Development..1

    52/76

    52

    3.2 BEST ANDROID APPS 2010

    If you, like me, have come to love and depend on your android based phones, you must have

    had a look at some some of the best android applications for your phone. It's very important

    to know which are best android apps for your phone otherwise you would be just

    downloading plenty of applications and filling up your phone. Blackberry mobile phones also

    support the android operating system.

    3.2.1 Shopsavvy: Shopsavvy was first publicized heavily as the first mobile's TV ad.

    Shopsavvy allows you to scan the bar code of any product with the help of your camera and

    you can also check the prices local and online so that you can get the best deal. You can also

    check out product reviews and set the application on an alert mode to let you know when the

    price of that product falls down. This great application is only available on android.

    3.2.2 BeebPlayer: In recent times iplayer is one of the most popular on demand video

    player in the market. But you can't use it on your android phone, so let's try out the

    beebplayer. Beebpalyer provides support for two stream qualities wi-fi and 3G. It also plays

    live streams of TV and radio. Beebplayer is only available to download android market and is

  • 8/8/2019 Android Operating System and Its Application Development..1

    53/76

    53

    one of the best android apps for HTC Hero. If you own a blackberry, then have a look at

    some blackberry apps to add some new cool features to make your phone look cool.

    3.2.3 Locale: Truly one of the best android apps that I love. Locale changes the phone

    settings according to the location of your phone. It always seems a little confusing at first but

    once you start using it you will be comfortable with it. Let's take an example, you can set a

    reminder for charging as soon as your phone battery goes low or you can also set the phone to

    go on silent mode as soon as you enter a cinema hall.

    3.2.4 Shazam: It is a wonderful apps for android systems. It's a favorite pick for all android

    users in 2010. But instead of paying premium rates for shazam it is now available free of

    charge. Shazam is a music tagging system, that helps you identify all the details of the song

    like names of artists, albums etc. Shazam is also one of the best android apps for your droid

    phone.

    3.2.5Best Android Games

    Here is a list of free mobile games which are currently available on the android platform.

    y Bonsai Blasty Abductiony Battleshipy Robot Defensey Cestos

    3.2.6Best Android Widgets

    Android has come up with some really cool and nice widgets and they are getting popular

    with people all around. I have listed the top three.

    3.2.7Android Agenda Widget: Agenda is a fun android widget and this widget displays

    important events from your corporate calender. Now available in the android market it helps

    you to pull and remind you of the meeting information.

    3.2.8News and Weather Widget: This is a free widget and it's suited for everyone who

    is interested or follows news and someone who also requires detailed weather information.

  • 8/8/2019 Android Operating System and Its Application Development..1

    54/76

    54

    3.2.9Stock Facebook Widget: Stock facebook is also a very popular android widget

    and is freely available in the android market. This widget works for both HTC hero and droid.

    So these were some of the best android apps available in the market. There are some best

    cydia apps which support your cydia smart phone and makes it handy. If you know some

    more cool applications for android phones do revert to me.

    3.3ANDROID APPLICATION DEVELOPMENT

    Ever since the release date of Google Android Operating System, Google Android

    applications market has been growing day by day. From the time when this operating system

    has taken the world of mobile application development by storm, it has been achieving

    popularity over mobile application development. With these trends, it has been competing

    very well in the mobile technology world and has seen a gradual increase in the number of its

    smart phone users.

    Mobiles growth curve is strong and mobile is becoming quite a phenomenon on the Internet.

    It is true that number of Android applications is fewer in comparison to iPhone, BlackBerry

    and Symbian; but with time, use of Android Apps has increased.

    Now Android Operating System with its applications is getting a strong hold to rule the

    smartphone market. In recent days we have seen the phenomenal growth of Android Platform

    i.e. 15 points jump in just 3 months. No other hand phone device has shown such tremendous

    growth within such a short span.

    Google Android is an open source platform. It has become popular among Android

    application developers because they don't have to pay any license fee for its development.

    Similarly there is no restriction imposed by its company like you find in case of iPhone and

    other operating systems. There are no problems of lock or unlock and jailbreak etc.

    Android has a huge developer community. Being an open source development, you can take

  • 8/8/2019 Android Operating System and Its Application Development..1

    55/76

    55

    benefits from this big community. For any kind of problem during development stage

    Android developers can take help of the community to solve that problem including

    debugging of Android apps.

    As Android is based on Linux core, it exhibits rock solid stability. It never crashes easily. It

    also shows security against viruses. Android Apps developed on this platform exhibit same

    characteristics and hence, they are more stable ones.

    Android apps are not sold cheap in the market. So it is good opportunity for the third party

    Android Application development companies. These companies may have good return over

    their investment on Application developments.

    3.3.1MOBILE APPLICATION DEVELOPMENT ON

    ANDROID APPLICATION DEVELOPMENT

    Android, Google's mobile operating system is fast gaining in popularity in a smartphone

    market that could be shaping up as a two-platform contest between the iPhone and Android.

    If Android maintains, or as it appears, ramps up its expansion, it will propel the open-source

    technology platform into a powerful and attractive ecosystem that allows developers create

    low-cost apps the masses can afford.

    3.3.1ANDROID APPLICATION DEVELOPMENT

    Advanced Media Productions offers expertise in mobile software application architecture and

    development, user experience and design, project management, and application deployment.

    This allows us to offer our clients top-quality application development services for the

    Android operating system with Java and Simple programming language. Our team of skilled

    Android software developers can help you create the specific, customized applications you

    need to meet your business goals.

  • 8/8/2019 Android Operating System and Its Application Development..1

    56/76

    56

    3.3.2ANDROID APPLICATION DEVELOPMENT PROCESS

    the Android platform is very similar to any regular software development project and

    comprises such stages as requirements gathering, design, prototyping, development of

    functional releases, quality control and product life cycle management.

    3.3.3ADVANCED MEDIA PRODUCTIONS PROVIDES A COMPLETE

    AND INTEGRATED ANDROID APPLICATION DEVELOPMENT

    SERVICES

    To provide businesses and organizations with an opportunity to use mobile business

    applications and games to boost brand visibility, drive engagement and generate web site

    traffic, leads and sales, Advanced Media Productions offers mobile application developmentservices for the development of applications that run natively on a smartphone with the

    Android operating system. Our mobile team consists of experts in mobile application

    development and testing, that can develop high quality Android software programming

    solutions for clients world-wide.

    Whether you are a company taking its first steps into the mobile and Android space or a large

    wireless carrier or handset manufacturer of mobile devices, we transform your ideas into

    robust and easy-to-use Android applications.

    3.3.4MOBILE DEVELOPMENT STRATEGY

    Our application development process begins with gathering of the customers' goal, business

    objectives and strategy to ensure the longterm success of the application from concept

    evaluation to development and product life cycle management. Our development team has

    the experience to identify and exploit the opportunities that add value to the mobile

    application and your business and can assist you with difficult implementation decisions and

    tradeoffs between cost, functionality and cool features.

    Whatever the need, Advanced Media Productions works with you to bring our application

    development, mobile experience and a technology-agnostic approach - ensuring you are

    getting the right mobile experience for you and your customers.

  • 8/8/2019 Android Operating System and Its Application Development..1

    57/76

    57

    process for the development of Android applications using the Android SDK. Our

    development method for the Android covers the entire process from design, development to

    deployment of the application to the Android Marketplace and product life cycle

    management. Not only has our development team extensive experience with development of

    high performance mobile applications, our team also has significant expertise in the areas of

    user experience design and usability.

    Our Android application development services include:

    y Android mobile applications and game developmenty Web-based applications development for mobile devicesy Android multimedia mobile solutions developmenty Migration of existing applications to the Android platform

    3.3.5ANDROID MOBILE APPLICATION BENEFITS

    Android mobile applications offer the following benefits:

    y Extended functionality - Mobile applications can provide application functionality orutility that is not natively available on the Android smartphone or is significantly

    better than what currently exists

    y Remote access - Mobile applications can extend business software functionality forfield employees and give their employees the opportunity to access information easily

    from anywhere where they have access to the Internet

    y Brand visibility - Mobile Android applications offer deep aligned and integratedbrand experiences any time they are used

    y Monetization - Mobile Android applications allows developers and publishers tomonetize the apps by serving text, image and rich media ads on CMP basis

    3.3.6Android Smartphones are all over Hong Kong and

    even on Mini-Buses

    September 24th,2010

  • 8/8/2019 Android Operating System and Its Application Development..1

    58/76

    58

    Yesterday ni t I was wal ing around Kowloon site of Hong Kong and saw a couple of so

    called MiniBuses t at were showing hundreds of Android smartphones on an ad that was

    obviously promotingjust Android. Checkit out:

    Zoomed in a bit further, you can see that there are loads of little droids on the banner.

    Though, I dont quite understand what the app is talking about (my Cantonese / Chinese

    reading is nearly not existing) I reckon that ad is there tojust advertise for Android.

    With a smart phone penetration of 58% (if I remember correctly), every second mobile in

    Hong Kong is a smartphone. While the i hone is stillthe main smartphone used for personal

    and the BlackBerry for business life, Android phones are getting more and more popular

    like everywhere in the world. Most ofthose new Android phones are built in Asia anyway

    and therefore, they hit Hong Kong very early after being released publicly.

    If you have a nice Android picture in reallife, let me know. I might putit up as well

  • 8/8/2019 Android Operating System and Its Application Development..1

    59/76

    59

    3.3.7 DANGER, BLACKBERRY, AN ANDROID WANTS

    TO EAT YOU!

    Googles Android mobile operating system is gaining momentum in the

    enterprise smartphone market against the BlackBerry OS from rival

    Research in Motion, according to a recent ChangeWave survey.[1] Based

    on Androids impressive security and multitasking features, we think it

    will continue to be a formidable competitor going forward.

    Thats bad news for RIM investors. We see a potential 10% downside to

    the $72 Trefis stock price estimate for RIM if its share of the enterprise

    market continues to decline.

    MOBILE ENTERPRISE FORECAST

    RIMs share of the enterprise smartphone market fell from 76% in

    November 2008 to 66% in August 2010, according to ChangeWave.[2]

    Androids enterprise share rose from 10% to 16% during the same period.

    On the other hand, RIMs share of the global mobile phone market should

    reach 3.7% this year, up from 2.7% in 2009. We expect this growth to

    continue in coming years, reaching 8% by the end of Trefis forecast

    period. According to Gartner, Android-based handsets accounted for3.9%

    of the global mobile phone market last year. Gartner expects Android to

    power30% of all mobile phones sold in 2014.

    ANDROID VS. BLACKBERRY

  • 8/8/2019 Android Operating System and Its Application Development..1

    60/76

    60

    Android is based on the open-source Linux operating system, which has an

    excellent record of resisting malware attacks. Android and BlackBerry

    both offer excellent multitasking capacity compared to Applesi .

    However, Android is far ahead ofRIMin the app sweepstakes, with about

    70,000 apps in its apps store compared to RIMs 10,000

    3.4GOOGLE O E T OR ANDROID

    y Homey Blogy Forum

    Thank you to all participants in Google's Android DeveloperChallenge! Many excellent apps

    were submitted and you can find most ofthem now on Android Market. Congratulations to

    all ofthe winners!

    Android is a software stack for mobile devices that includes an operating system,

    middleware, and key applications. The Android SDK provides the tools and libraries

    necessary to begin developing applications that run on Android-powered devices.

    This site provides information about Google projects based on the Android platform, such as

    externallibraries that extend the platform, hosted services and APIs, and more. Everything on

    this site is provided by Google forthe benefit of Android developers. If you are interested in

    developing applications for Android devices, please visitthe Android

    3.4.1GOOGLE APIS ADD-ON

  • 8/8/2019 Android Operating System and Its Application Development..1

    61/76

    61

    The Google APIs add-on extends your Android SDK to give your applications access to

    Google libraries such as Maps. Using the Maps library, you can quickly add powerful

    mapping capabilities to your Android applications.

    3.4.2ANDROID CLOUD TO DEVICE MESSAGING

    Android Cloud to Device Messaging is a service that allows you to send lightweight

    messages from your application server to an Android application on a device. You can use

    the service to tell the application.

    3.5GUIDE FOR ANDROID APPLICATION

    DEVELOPMENT

    This article provides the basic information about android application development. What

    things must be known to every android developer like Android SDK, tools, plugins and

    version of Android Operating System

    Today Google is a giant search engine. On internet, Google has multiple products like Google

    reader, Google buzz, Gmail, Google books and many more. In addition, it has popular

    browser called Google

    Android is very popular word today on internet and in real world. However, what is Android?

    When you see the title of this article then you are confusing. If you dont know aboutAndroid then you waste your time to read this article. However, dont worry. Android is an

    operating system like Window but not for computers its for Mobile devices like cellular

    phones, tablet computers and notebooks. Android Inc developed it but then after Google

    Purchased It.

  • 8/8/2019 Android Operating System and Its Application Development..1

    62/76

    62

    Android operating system software consists java applications and running on java based

    fretworks which contains top java libraries. So people who familiar with java and java

    application development easily create any android application. Android Operating System

    consists five important parts, which are application, application framework, libraries, android

    run time, and Linux kernel.

    There many version for released for Android OS system which are Android 1.1, 1.5, 1.6, 2.0,

    2.0, 2.1. Current version is 2.1 and 2.2 is yet not released. If you want to create any android

    applications then you must have Android SDK, Eclipse, and ADT Plug in.

    The Android SDK provides you various tools, and API, which are necessary for developing

    any Android application on Android platform using Java programming language. If you

    install Android SDK on your computer then your system must run on Windows XP (32-bit)

    or Vista (32- or 64-bit) and Mac OS X 10.5.8 or later (x86 only) operating system. Latest

    Version of SDK is 2.1. Also you have some supported development environment like Eclipse

    IDE, Eclipse JDT plugin, JDK 5 or JDK 6 or Android Development Tools plugin (ADT

    PlugIn).

    In android application development, the user interface (UI) is build using View and

    ViewGroup objects. In addition, Android SDK contains some tools for debug your

    application like Android Debug Bridge (ADB), Dalvik Debug Monitor Server (DDMS),

    Traceview, logcat, and Eclipse ADT plugin.

    After developed any application then main part is testing. If you developed your application,

    using Eclipse and ADT then you can test your application within an emulator or the device

    you on which you run your application Android SDK has various custom tools, which are

    helpful android developers to create any android application such as

    y Android Development Tools Pluginy Android Emulatory Android Virtual Devices (AVDs)y Hierarchy Viewery layoutopty Draw 9-patch

  • 8/8/2019 Android Operating System and Its Application Development..1

    63/76

    63

    y Dalvik Debug Monitor Service (ddms)y AndroidDebugBridge (adb)y Android Asset Packaging Tool (aapt)y Android Interface Description Language (aidl)y sqlite3y Traceviewy mksdcardy dxy UI/Application Exerciser Monkeyy androidy zipalign

    Okie finally your application developed successfully now the final step is Applicationinstallation on particular devices. If you want to move your application on external devices

    then you must declare "android:install Location" manifest attribute within your application. If

    you application is big size means in megabytes then its depend upon you that you install your

    application in internal devices or in external device. Finally, I hope you got the basic idea for

    Android application development .

  • 8/8/2019 Android Operating System and Its Application Development..1

    64/76

    64

    3.6 SETTING UP AN ENVIRONMENT FOR ANDROID

    DEVELOPMENT / TESTING

    y Download Android SDK from http://developer.android.com/sdk/index.htmly Unzip to a folder of your choice. We'll refer to this folder as SDK_HOMEy Launch the Android SDK and AVD manager (On windows:

    SDK_HOME\Tools\android.bat, On Mac/Linux: SDK_HOME/Tools/android )

    y Install at least on Android Package:o Click on "Available Packages"o Expand the tree on the right.o Select a package, e.g. SDK Android 2.1, Android API7, revision 2o

    Click "Install"

    o If you get an "HTTP SSL error" as in the following picture,

  • 8/8/2019 Android Operating System and Its Application Development..1

    65/76

    65

    Then go to "Settings" and check the option "force https://... sources to be fetched using http://..."

    o Then go back to "Available Packages" as abovey Create an AVD ("Android Virtual Device" as follows:

    o Click on "Virtual Devices"o Click "New"o Select (1) Device Name, (2) Target (the package you downloaded), (3) Memory

    card size.

    o If you want to use the camera in your applications, add Camera support by (4)clicking "New" in the hardware area, (5) selecting camera support in the drop

    down menu and (6) Clicking "OK"

  • 8/8/2019 Android Operating System and Its Application Development..1

    66/76

    66

    "

    o Change "Camera Support" option to "true" (7) [If you added camera support

  • 8/8/2019 Android Operating System and Its Application Development..1