11-02-2013, 02:38 PM
Porting mobile web application engine to the Android platform
1Porting mobile web.pdf (Size: 490.58 KB / Downloads: 16)
Abstract
Android which Google released as an open-source
mobile phone operating system is a Linux-based
platform; it consists of the operating system,
middleware, and user interface and application
software. xFace is a cross-platform web application
engine for mobile Internet. As a global leader in
mobile web application engine, xFace [1] has the
advantages of versatility, easy to master, universal. It
significantly reduces the effort of development; while
the services of testing which porting layer provides,
will greatly reduce the developer's development costs.
A perfect transplant will greatly reduce the Android
platform migration workload, but also to make
widget's operating efficiency to be improved. This
paper describes xFace of native code (c + +) runs on
the Android (java) platform through JNI called, xFace
porting layer(c++) also calls the Android platform
APIs(JAVA) by JNI, such as Graphics, HTTP and
other related system modules.
Introduction
Along with the continuous development of
communication industry, today's mobile terminals have
extended from single service with telephone to
multiple services with voice, data, images, video and
games [2]. Communications, computing and Internet
convergence will be trend of the information and
communication technology development in the future.
Nowadays, operators’ services have erected one by one
in the open data services, a unified service --- the
platform for mobile Internet. The step into data transfer
is an important stage in the development of the 3G. It
provides rich data services also contributed to the
development of smart mobile devices. Under the
impact of the 3G, mobile terminals gradually turn to be
intelligent. Under a variety of 3G services such as
mobile instant messaging, mobile email, mobile
search, online browsing.
xFace mobile web application engine
xFace is composed of xFace engine and platform
adaptation layer (also known as Porting layer), xFace
engine is mainly responsible for page layout, script
analysis, logic and other functions, the porting layer is
mainly responsible for abstracting the operating
system-related functions into the system-independent
in order to make xFace run on different platform.
Porting the xFace native Code to
Android
Bulit the environment
Android platform,
because of mixture of programming language, we use
Eclipse and the Android environment NDK as the
environment of compilation. NDK is primarily used to
compile xFace core and porting layer, and it compiles
the starting-entry(C/C++) of xFace into dynamic
library. Eclipse is mainly used to build Android
application development environment, needed ADT
plug-in. At last, we use Eclipse to package the program
and the dynamic library, which is generated by NDK,
into Android executable files – DEX files.
Android NDK: Android NDK is the acronym for
Native Development Kit. Android application
developers can use NDK to develop C/C + + native
code. In this plan, we also need to use it to develop
C/C + + native code and call the java classes and
methods by JNI.
Integration of the porting layer and core
After porting layer of each module completed, we
can integrate it with xFace engine. Each module of
xFace engine also needs to NDK environment to be
compiled into static libraries. All of those static
libraries are supplied for xFace program entry module
calling. xFace program entry module which is called
by JAVA is responsible for the performance of xFace
capacity module. This module depends on the xFace
engine and platform adaptation layer, and must follow
the norms of java call native code compiled into
dynamic link libraries and by the Eclipse environment,
written in java program packaged with the framework
to Android emulator to run.
Application framework entrance
Application framework entrance is primarily
responsible for starting the xFace; Developed by
JAVA language. And its main function is that prepare
for running xFace in the Android platform, to provide a
running environment, and the creation of the window
and dispatch the event information to xFace native
layer. As the Android applications are running on
Dalvik virtual machine, so the program must start by
the way of JAVA. It is a bridge of communication
between xFace Native framework and Android, so it is
essential.
Summary
Currently almost all of the transplants, the source
build-environment of transplant and the target
platform build-environment are basically the same.
This migration plan of mixed programming language
provides a general method for the situation that the
source and the target platform of build-environment
of transplant are different; furthermore, this solution
also makes code-reuse to maximize and reduces
development costs and cycle.