基于安卓平台的移动应用的研究与开发外文翻译资料

 2022-01-26 09:01

International Journal of Multimedia and Ubiquitous Engineering Vol.9, No.4 (2014), pp.187-198 http://dx.doi.org/10.14257/ijmue.2014.9.4.20

Research and Development of Mobile Application for

Android Platform

Li Ma1,2,3, Lei Gu1,2 and Jin Wang1,2,3

1Jiangsu Engineering Center of Network Monitoring, Nanjing University of

Information Science amp; Technology, Nanjing 210044

2School of Computer amp; Software, Nanjing University of Information Science amp;

Technology, Nanjing 210044

3Key Laboratory of Meteorological Disaster of Ministry of Education Nanjing

University of Information Science amp; Technology, Nanjing 210044

Abstract

Today, as the developing of hardware of mobile is getting better, the performance index is much higher than the actual requirements of the software configuration. Phone#39;s features more depend on software. As the Android operating system is getting more popular, the application based on Android SDK attracts much more attention. But now, some of the Android application interface is too cumbersome, pop-up ads is overmuch and the function is too single, these cause some inconvenience to the users. This article presents the application by eliminating the redundancy. Three kinds of applications are developed base on Java and Android SDK --- Weibo client, video player and audio player. The audio player uses the ContentResolver and Curor to obtain music files and plays the music by using the Service Components to call the Media Player class in the background. The video player uses the Media Player class provided by Android SDK. This class loads the file through URL, realize the multimedia file parsing by calling the OpenCore Library, which is at the bottom of Android, through JNI and by calling the SurfaceFlinger interface to realize the video filesrsquo; playback. The usersrsquo; data is collected through the Sina open platform called by Sina client and the data will be returned under the format of JSON by the Sina server. The system uses the OAuth authentication method for user authorization to complete the login process. The specific functions of this system are developed based on Android Weibo SDK. The interfaces of these Android apps are pretty and the operation is smooth. Whatrsquo;s more, the cumbersome interface and excessive advertising are eliminated, so that users are able to manipulate these apps more conveniently and smoothly.

Keywords: Android, Weibo client, Video Player, audio player, Android SDK

1. Introduction

In recent years, the emergence of smart phones has changed the definition of mobile phones. Phone is no longer just a communication tool, but also an essential part of the people#39;s communication and daily life. Various applications added unlimited fun for people#39;s lives. It is certain that the future of the network will be the mobile terminal.

Now the Android system in the electronics market is becoming more and more popular, especially in the smartphone market. Because of the open source, some of the development tools are free, so there are plenty of applications generated. This greatly inspired the people to

ISSN: 1975-0080 IJMUE

Copyright ⓒ 2014 SERSC

International Journal of Multimedia and Ubiquitous Engineering Vol.9, No.4 (2014)

use the Android system. In addition, it provides a very convenient hardware platform for developers so that they can spend less effort to realize their ideas. This makes Android can get further development [1-4].

As the smart phones and Android system getting popular, the operations like listening to music, watching videos, tweeting and some others can be moved from the computer to a phone now.

The applications on the market today are mostly commercial applications, and contain a large number of built-in advertising. If the user prefers to remove the built-in advertising, a certain price must be paid to reach that and this is not convenient. Meanwhile, because of the unfair competition of IT, many applications built illegal program to steal user information and cause some damage to userrsquo;s personal privacy. Sometimes, users will pay more attention to the user experience of software. Therefore, the development of the application can not only be limited to the function, more attention should be paid to the user#39;s experience. After studying some previous Android applications and access to large amounts of materials, we utilize the Java language, the Eclipse platform, Android ADT and the Android SDK to develop these three mobile applications. These systems have a nice interface and smooth operation. These Apps wonrsquo;t steal any personal information, but can exclude useless information and bring a wonderful user experience.

2. Android Architecture

We studied the Android system architecture. Android system is a Linux-based system, Use of the software stack architecture design patterns [1-2].

As shown in Figure 1, the Android architecture consists of four layers: Linux kernel, Libraries and Android runtime, Application framework and Applications [5-8].

Each layer of the lower encapsulation, while providing call interface to the upper.

Applications

Home Phone Browser ...

Applications Framework

Activity

Window

Content

...

Manager

Manager

Providers

Libraries

Android Runtime

全文共28345字,剩余内容已隐藏,支付完成后下载完整资料


International Journal of Multimedia and Ubiquitous Engineering Vol.9, No.4 (2014), pp.187-198 http://dx.doi.org/10.14257/ijmue.2014.9.4.20

基于安卓平台的移动应用的研究与开发

Li Ma1,2,3, Lei Gu1,2 and Jin Wang1,2,3

1Jiangsu Engineering Center of Network Monitoring, Nanjing University of

Information Science amp; Technology, Nanjing 210044

2School of Computer amp; Software, Nanjing University of Information Science amp;

Technology, Nanjing 210044

3Key Laboratory of Meteorological Disaster of Ministry of Education Nanjing

University of Information Science amp; Technology, Nanjing 210044

摘要

今天,随着移动硬件的发展正在变得越来越好,性能指标远远高于软件配置的实际要求。手机的功能更多地依赖于软件。随着Android操作系统变得越来越流行,基于Android SDK的应用程序吸引了更多的关注。但是现在,一些Android应用程序界面过于繁琐,弹出式广告过多且功能过于单一,这些都给用户带来了一些不便。本文通过消除冗余来介绍应用程序。基于Java和Android SDK开发了三种应用程序 - 微博客户端,视频播放器和音频播放器。音频播放器使用ContentResolver和Curor来获取音乐文件,并使用服务组件在后台调用Media Player类来播放音乐。视频播放器使用Android SDK提供的Media Player类。该类通过URL加载文件,通过调用位于Android底部的OpenCore库,以及通过JNI和调用SurfaceFlinger接口实现视频文件的回放,借此来实现多媒体文件解析功能。用户的数据通过新浪客户端调用的新浪开放平台收集,数据将由新浪服务器以JSON格式返回。系统使用OAuth身份验证方法进行用户授权,以此来完成登录过程。该系统的具体功能是基于Android Weibo SDK开发的。这些Android应用程序的界面非常的漂亮,操作起来也是非常的流畅。更重要的是,消除了繁琐的界面和过多的广告,所以用户才能够更方便,更顺畅地操作这些应用程序。

关键词:安卓,微博客户端,视频播放器,音频播放器,安卓SDK

  1. 介绍

在近些年来,智能手机的出现已经改变了手机的定义。 电话不再仅仅只是一种沟通工具,也是人们之间相互沟通和日常生活的必不可少的重要组成部分之一。 各种应用为人们的生活增添了无限乐趣。 可以肯定的是,网络的未来将会是移动终端。

现在,电子市场中的Android系统正在变得越来越流行,特别是在智能手机市场这个行业里面。 由于开源的原因,一些开发工具是免费的,因此就生成了大量的应用程序。这极大地激发了人们对于使用Android系统的兴趣。 除此此外,它为开发人员们提供了一个非常方便的硬件平台,因此他们可以花更少的精力来实现他们自己的想法。 这也使得Android可以得到进一步的发展[1-4]。

随着智能手机和Android系统变得越来越受欢迎,现在可以将听音乐,观看视频,发送推特和其他一些操作能够被从计算机移到一部手机上。

目前市场上的应用程序大多数是商业应用程序,并包含了大量内置广告。如果用户更喜欢删除这些内置广告,则必须支付一定的价格以达到该目的,这并不方便。与此同时,由于IT的不公平竞争环境,许多应用程序构建了非法程序来窃取用户信息并对用户的个人隐私造成一些损害。有时,用户会更加关注软件的用户体验。因此,应用程序的开发并不仅仅仅限于功能,更多的注意力应该被集中到用户的体验上面。在研究了一些以前的Android应用程序并访问大量的材料之后,我们利用Java语言,Eclipse平台,Android ADT和Android SDK来开发这三个移动应用程序。这些系统具有非常良好的界面和极其流畅的体验。这些应用程序不会窃取任何个人信息,但可以排除那些无用的信息并且能够带来精彩的用户体验。

  1. Android架构

我们研究了Android的系统架构。 Android系统是一个基于Linux的系统,使用软件堆栈架构设计模式[1-2]。

正如图1所示的那样,Android架构由四层组成:Linux内核层,Libraries和Android实时运行层,Application框架和Applications [5-8]。

每一层都被完好无损的封装的,同时为上层提供调用接口。

图1. Android架构

2.1 应用

Android应用程序将会被附带一组核心的应用程序,包括客户端,SMS程序,日历,地图,浏览器,联系人等等以及其它软件。 所有这些应用程序都是用Java来开发的。

2.2 应用框架

开发人员被允许去访问核心程序的所有API的框架。应用程序框架简化了其组件的重用。任何其他应用程序都可以发布其功能组件,所有其他应用程序可以访问和使用此组件(但必须去遵循框架的安全性)。与用户能够用此重用机制替换程序组件相同。

2.3库和Android运行

该库被划分为为两个组件:Android Runtime和Android Library。 Android Runtime由Java Core Library和Dalvik虚拟机组成。Core Library为Java核心库提供了绝大多数的功能。 Dalvik虚拟机是注册虚拟机,并且对移动设备进行了一些具体的改进。

Android系统库是支持应用程序框架,它也是连接应用程序框架和Linux Kernel的重要环节。这个系统库以C或C 语言开发。这些库也可以被Android系统中的不同的组件使用。它们通过应用程序框架为开发人员提供服务。

2.4 Linux内核

Android内核层提供的内核系统服务是基于Linux 2.6内核的,像内部存储,进程管理,网络协议,底层驱动等操作和其他一系列的核心服务均是基于Linux内核的。

3.实验方法

3.1 视频播放器

Video Player是通过Eclipse平台实现的。 为了能够开发Android应用程序,我们将为Eclipse安装上一个插件:Android开发工具(ADT)。 安装完成后,下载Android SDK [10,12],安装并配置SDK,然后我们就可以开发视频播放器了。

我们的研究开始于对操作机制,Android平台媒体层结构,xml可定制界面,内容提供商[9]的研究,实现文件扫描以获取媒体文件的列表,MediaPlayer类,文件解析,Surface Flinger界面。在那之后,我们可以开发基于Android的移动视频播放器。 实现媒体库,视频播放器,文件打开,音频,视频,照片等等以及其它的功能。 图2是系统流程图

图2.系统流程图

软件界面通过XML文件定义。 XML布局文件控件视图,不仅非常简单,而且还从Java代码中隔离View控件逻辑并通过插入XML文件进行控制。 以用一种更好的方式反映MVC原则,也反映了逻辑和视图分离的原则。 该软件通过扫描内容提供商获取媒体文件列表。 内容提供商被认为是数据存储和跨程序搜索之间的桥梁。 该功能是实现不同应用程序之间的数据共享,这也是与其他应用程序共享数据的唯一方式。 图3显示了媒体层结构[13]

图3.媒体层结构

Android-MediaPlayer的上层应用程序由JAVA实现,实现了逻辑处理。 JAVA程序通过JNI接口调用底层媒体库libmedi.so来实现视频文件和在线视频的播放。

MediaPlayer在运行时大致可分为两部分:Client和Server。 它们在两个独立的进程中运行。 Binder用于它们之间实现IPC通信。 图3中的Mediaplayer service是服务器端实现存储库。

MediaPlayer调用Opencore [14]提供的媒体播放功能来实现视频文件播放,Opencore负责媒体文件格式解析,解码音频和视频数据,以及输出媒体数据。 Opencore调用Surface Flinger接口实现视频数据的显示,并通过应用Audio Flinger接口实现音频数据的播放。

在Android媒体层中,最重要的类是MediaPlayer。 MediaPlayer类及其相关结构如图4所示。

图4. MediaPlayer类层次结构图

Upper JAVA程序调用底层MediaPlayer类来实现媒体流。首先,MediaPlayer类通过IService _Manager getService接口获取media.player服务的名称。之后,所有操作都通过此MediaPlayer播放器进行,界面为IMediaPlayer。图4中的所有BpXXXX类都是代理类,其职责是通过Binder机制将客户端请求发送到服务来实现消息转发。服务端的相应BnXXXX子类负责实现特定功能。通过MediaPlayerInterface接口调用底层Opencore库来实现最终广播媒体流的播放。该类通过Uri加载预先播放的文件,调用OpenCore多媒体库通过JNI实现文件解析,通过调用SurfaceFlinger接口实现视频文件的播放,通过调用AudioFlinger接口实现音频数据的播放。软件界面简单,功能丰富,操作流畅,并通过调用外部程序实现音频和图像回放。图5显示了视频播放器界面。

图5.视频播放器

3.2 音频播放器

音频播放器开发工具与视频播放器相同。 系统结构和过程与视频播放器的过程相同。 还定义了Application Framework层中的接口,然后通过Android Framework层中的ContentResolver获取音乐文件。 最后,使用Service组件调用Libraries层中的MediaPlayer类来播放音乐。 系统结构如图6所示。

图6.系统结构

主界面模块是应用程序的入口。 用户将在启动应用程序后看到主界面模块。 模块本身不向用户反映任何信息,只显示呼叫列表模块。 演示了三个列表:音乐列表,专辑列表和艺术家列表。 主界面模块通过调用MusicListActivity,AlbumListActivity和ArtistListActivity [15]模块来实现。 主界面逻辑图如图7所示。

图7.主界面逻辑图

图8是具体的流程图

图8.音频播放器流程图

音频文件扫描仪模块负责扫描SD卡上的所有音频文件。这个模块中的SongManager是一个类,这个类有一个静态方法来访问SD卡。静态方法使用Android系统提供的Cursor类方法获取SD卡音频资源,并将接收到的音频资源转换为List类实例对象。 List的成员是JavaBean - 应用程序中使用的音乐。列表数组最终将返回到它们调用它的其他模块。列表模块MusicListActivity,AlbumListActivity和ArtistListActivity模块将调用此模块。

适配器模块是一种将List lt;?gt;类的实例对象映射到ListView的工具。此应用程序中的适配器模块将获取由SongManager模块生成的List lt;Musicgt;实例对象,并将其映射到MusicListActivity和其他模块中的ListView视图组件。

列表模块不会单独向用户显示,而是由主接口模块调用。该模块有三个并行部分:MusicListActivity,ArtistListActivity和AlbumListActivity。它们的功能是在主界面中显示歌曲列表,艺术家和专辑列表。这些并行模块将调用SongManager类中的静态方法来获取List lt;Musicgt;实例对象,然后调用适配器模块来处理获取的List lt;Musicgt;实例对象。然后,将List lt;Musicgt;映射到其自己的ListView组件。当用户选择ListView的元素时,该模块将信息封装到intent对象中并将其发送到音乐回放模块。

音乐播放模块收集从List模块发送的意图并对其进行分析,然后调用背景音乐服务播放音频文件。

全文共9396字,剩余内容已隐藏,支付完成后下载完整资料


资料编号:[480]

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。