0% found this document useful (0 votes)
34 views4 pages

Icinis 2011 40

Uploaded by

taskmaster37742
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

Icinis 2011 40

Uploaded by

taskmaster37742
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2011 Fourth International Conference on Intelligent Networks and Intelligent Systems

Research on Development of Android Applications

Jianye Liu Jiankun Yu


School of Information School of Information
Yunnan University of Finance and Economics Yunnan University of Finance and Economics
KunMing, China KunMing, China
[email protected] [email protected]

Abstract—Introduced the Android platform and the features of


Android applications, gave a detailed description of Android
application framework from the prospective of developers. A
simple music player is provided as instance to illustrate the
basic working processes of Android application components.
This paper could provide guidance to understanding the
operation mechanism of Android applications and to
developing applications on Android platform.

Keywords-Linux kernel;Android system;


Application framework;Dalvik virtual machine;

I. INTRODUCTION
Application framework defined the common structure of
programs in the specific domain. Essentially, a framework is
a component that can be reused, it set the architecture of
Figure 2 - 1
applications and incorporated as a set of abstract classes and
the cooperation of their instances. Android is an open source
Applications layer is the site of all Android applications
operating system based on Linux kernel and launched by
including an email client, SMS program, maps, browser,
Google. Unlike PC operating system, mobile phone
contacts, and others. All applications are written using the
operating systems are constrained by their hardware, storage
Java programming language.
space, power dissipation and mobility conditions. Compared
Application framework layer defined the Android
with the development of applications on PC, there are some
application framework. All Android applications are based
different features of applications on mobile phone operating
on the application framework. The Android application
systems. This paper introduced the basic architecture and
framework including:
application framework of Android operating system, gives a
detailed description of main structure of Android • A rich and extensible set of Views that can be used
applications and the methods of developing applications to build an application with beautiful user interface,
based on Android application framework. including lists, grids, text boxes, buttons, and even
an embeddable web browser.
II. INTRODUCTION OF ANDROID OPERATING SYSTEM • A set of Content Providers that enable applications
to access data from other applications (such as
Android is a comprehensive operating environment that
Contacts), or to share their own data.
based on Linux® V2.6 kernel, it is also a layered system, the
• A Resource Manager that provides access to non-
architecture of Android system have show as picture 2-1[1].
code resources such as localized strings, graphics,
and layout files.
• A Notification Manager that enables all applications
to display custom alerts in the status bar.
• An Activity Manager that manages the lifecycle of
applications and provides a common navigation
back stack.[1]
Libraries layer includes a set of C/C++ libraries used by
various components of the Android system and provides
support to the application framework.

978-0-7695-4543-1/11 $25.00 © 2011 IEEE 69


DOI 10.1109/ICINIS.2011.40
Android Runtime includes a set of core libraries and a point through which the system can enter an application and
Java virtual machine (Dalvik virtual machine) that have been instantiate component object independently.
redesigned and optimized by Google to be suitable for There are four different types of application components.
Android platform. Each type serves a distinct purpose and has a distinct
Linux kernel is located at bottom layer of Android lifecycle that defines how the component is created and
system and acts as an abstraction layer between the hardware destroyed.
and the rest of the software stack. It provides core system Activity
services such as security, memory management, process An activity represents a single screen with a user
management, network stack, and driver model. In addition, interface. The activities in an application work together to
some bottom functions such as management of threads of form a cohesive user experience, but each one is independent
Dalvik virtual machine also rely on the Linux kernel. of the others. As such, a different application can start any
one of these activities. An activity is implemented as a
III. DALVIK VIRTUAL MACHINE subclass of Activity. The particular form that an activity
As previously mentioned, Android is running on the show users and the amount of activities in an application
Linux kernel and its applications are written by Java depend on how the developer design the application. In a
programming language, so Android applications are running multiple activities application, typically, one activity is
on a Java virtual machine named Dalvik virtual machine. specified as the "main" activity, which is presented to the
Dalvik virtual machine has been redesigned and optimized user when launching the application for the first time. Each
by Google for the hardware features of mobile devices. In activity can then start another activity in order to perform
Android system, there is a tool named dx, included in the different actions. Each time a new activity starts, the
Android SDK, transforms the Java Class files (which previous activity is stopped, but the system preserves the
compiled by a regular Java compiler) into the .dex format. activity in a stack (the "back stack"). The figure 4-1 shows
The .dex format files integrate all Java class files and delete the lifecycle of an activity.[1]
redundant information in every Java class files. There are
several features of Dalvik virtual machine:
• Dalvik virtual machine could have multiple
instances on one device and every instance runs in a
separate Linux process, an Android application runs
in an instance of a Dalvik virtual machine.
• Dalvik virtual machine relies on the underlying
operating system (Linux kernel) for process
isolation, memory management and threading
support.
• Dalvik virtual is register-based.
The follow figure (figure3-1) shows the position of
Dalvik virtual machine in Android system.

igure 4 - 1

Figure 3 - 1
Service
A service is an Android component that runs in the
IV. ANDROID APPLICATION COMPONENT background to perform long-running operations or to
perform work for remote processes and does not provide a
A core feature of Android is that one application could
user interface. An activity can connect or bind a service that
use component element that belong to another application (if
is running. (if the service is not running, launch it). When
the component is permitted using). In order to achieve such
connected to a service, the activity can communicate with the
functions, Android system must launch the application while
service through the interface that the service exposed. Like
any part of the application is asked and instantiate Java
other application components, service components always
objects that being asked. Unlike most operating system, there
running in the main thread of an application by default. So
is no single point that the system can enter in an Android
for the intensive or blocking operating a service performs
application (for example, there no main ( ) function in an
(may slow down activity performance), it is usually start a
Android application). Instead, each component is a different
new thread inside the service.

70
Content Providers permissions that an application requires, the
Content providers provide data share mechanism among application have permissions to perform operations.
applications. The data that be shared could in the file system, • Declare the minimum API level required by the
a SQLite database, or any other persistent storage location an application.
application can access. A content provider is implemented as • Declare hardware and software features used or
a subclass of Content provider, it defines the data format it required by the application.
supported and provides a set of method to enable other • Declare API libraries the application needs to be
applications to query or modify the data. But an application linked against.
does not call these methods immediately, instead, it call Resources are separate from the source code. In Android,
these methods by an object named Content Resolver. all non code resources are defined in XML files. For every
Content Resolver can communicate with every Content resource that included in an Android project, the SDK build
Provider. Content Resolver cooperated with Content tools define a unique integer ID, which can be used to
Provider to manger IPC (inter process communication) while reference the resource from the application code or from
sharing data. other resources defined in XML files. Providing resources
Broadcast Receivers separate from source code makes it easy to update various
Broadcast Receivers is in charge of the reception of characteristics of an application without modifying code and
system wide broadcast and take response aiming at the by providing sets of alternative resources enables developers
information that a broadcast transmitted. Many broadcasts to optimize the application for a variety of device
originate from the system—for example, a broadcast configurations, such as different languages and screen sizes.
announcing that the screen has turned off, the battery is low.
Applications can also initiate broadcasts. There could be any VI. AN MUSIC PLAYER
number of Broadcast Receivers in an application and each Here is a simple music player, the four components of
Broadcast Receiver implemented as a sub class of Broadcast Android have been defined in this example.
Receiver. Although broadcast receivers don't display a user MusicMainActivity is an object of Activity type, it provides
interface, they may create a status bar notification to alert the interface to users and communicates with a Service used to
user when a broadcast event occurs. More commonly, play music in background by a BroadcastReceiver.
though, a broadcast receiver is just a "gateway" to other MusicPlayerService is an object of extensional service type,
components and is intended to do a very minimal amount of it mainly used to play music in background and return play
work.[1] statues to MnsicMainActivity by broadcast.
Three of the four component types—activities, services, MusicInfoManager is a custom class, it packs a
and broadcast receivers—are activated by an asynchronous ContentProviders provided by system to get music
message named intent. Intents bind individual components to information from flash card. By the above components
each other at runtime no matter the component belongs to the cooperate with each other can realize the function of play
same application. An intent can create with an Intent object, music on android platform. The follow figure (figure 6-1 )
which defines the messages by which can activate either a show the interactive mode among the above components.
specific component or a specific type of component. For
activities and services, an intent defines the action to perform
and may specify the URI of the data to act ion. For broadcast
receivers, the intent simply defines the announcement being
broadcast. The other component type, content provider, is
not activated by intents. Rather, it is activated when targeted
by a request from a Content Resolver.[1]

V. NEW FEATURES OF ANDROID APPLICATIONS


As a young operating system, on one hand, Android
could benefit from mature technology of other operating
system. On the other hand, Android could also improve the
blemish that appears in other operating systems. On a
developer’s prospective, Android possess following new
features:
The permission that an application possessed has been
defined clearly. In android applications, all components that
could be independently launched by system need to be Figure 6 - 1
declared in a XML file named AndroidManifest. The
AndroidManifest does a number of things in addition to As is showed in the figure above, the MusicPlayerService
declaring the application’s components, including: run in background returns all play status to the
• Identify any user permissions the application MusicMainActivity run in foreground by broadcast (use
requires, such as Internet access. Only identify the intent as carrier). A BroadcastReceiver has registered in

71
MuxicMainActivity to receive all broadcast from applications. Finally, a music player on the android platform
MusicPlayerService. The received broadcast will be resolved was put forward as an example to illustrate this mechanism.
by MusicMainActivity. According to the broadcast content,
the MusicMainActivity will do some actions (show users the REFERENCES
play status ). After the music player launched, the
MusicMainActivity will send messages to [1] OL. Google Android Developers, Android Develop Guide,
MusicInfoManager for the information of music files and the http://developer.android.com/guide/topics/fundamentals.html
MusicInfoManager will activate a ContentProvider that [2] M. Fengsheng Yang, Android Application Development Revelation,
provided by system, then get the music files list and return it China Machine Press, 2010,1
to the MusicMainActivity. [3] M. Zhengguo Hu, Jian Wu, Zhenggong Deng, Programming
Methodology, National Defence Industry Press, 2008,6
ď. CONCLUSION [4] M. Junmin Ye, Software Engineering, Tsinghua University Press,
2006,6
Android as a full, open and free mobile device platform, [5] J. Dongjiu Geng, Yue Suo, Yu Chen, Jun Wen, Yongqing Lu,
with its powerful function and good user experience rapidly Remote Access and Control System Based on Android Mobil
developed into the most popular mobile operating system. Phoneˈvol.2. Journal of Computer Applications, 2011, pp. 560-562
This article gives a detailed introduction of Android [6] J. Li Lin, Changwei Zou, Research on Cloud Computing Based on
application framework and the working principal of Android Android Platform, vol.11. Software Guide, 2010, pp.137-139

72

You might also like