Android平台移动应用的研究与开发外文翻译资料

 2022-11-08 06:11

Research and Development of Mobile Application for Android Platform

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. Phones 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 ServiceComponents 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 ofJSON 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.

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 peoples communication and daily life. Various applications added unlimited fun for peoples 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 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.

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

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

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

2.1. Applications

Android app will be shipped with a set of core applications including client, SMS program, calendar, maps, browser, contacts, and others. All these application programs are developed in Java.

2.2. Application Framework

The developer is allowed to access all the API framework of the core programs. The application framework simplifies the reuse of its components. Any other app can release its functional components and all other apps can access and use this component (but have to follow the security of the framework). Same as the users can be able to substitute the program components with this reuse mechanism.

2.3. Libraries and Android Runtime

The library is divided in to two components: Android Runtime and Android Library.Android Runtime is consisted of a Java Core Library and Dalvik virtual machine. The Core Library provides Java core library with most functions. Dalvik virtual machine is register virtual machine and makes some specific improvements for mobile device.

Android system library is support the application framework, it is also an important link connecting between application framework and Linux Kernel. This system library is developed in C or C language. These libraries can also be utilized by the different components in the Android system. They provide service for the developers through the application framework.

2.4. Linux Kernel

The kernel system service provided by Android inner nuclear layer is based on Linux 2.6 kernel, Operations like internal storage, process management, internet protocol, bottom-drive and oth

剩余内容已隐藏,支付完成后下载完整资料


1.中文翻译

Android平台移动应用的研究与开发

摘要

今天,随着手机硬件的发展越来越好,各项性能指标都已经是远远高于软件配置的实际要求。手机的功能更多取决于软件所带来的功能。随着Android操作系统越来越受欢迎,基于Android SDK的应用吸引了更多人的关注。但现在,一些Android应用程序界面太繁琐,弹出广告变得过多,而同时功能又过于单一,这些都给用户带来一系列不便。本文通过消除冗余来介绍了应用程序,主要介绍的三种应用程序是基于Java和Android SDK开发的,包括有新浪微博客户端,视频播放器和音频播放器。音频播放器使用ContentResolver和Curor来获取音乐文件,并通过使用ServiceComponents在后台调用Media Player类来播放音乐。视频播放器使用Android SDK提供的媒体播放器类。这个类通过URL加载文件,通过调用位于Android底部的OpenCore库,通过JNI并通过调用SurfaceFlinger接口实现视频文件的播放来实现多媒体文件解析。用户数据通过新浪客户端打开的新浪开放平台收集,新浪服务器将以jSON格式返回数据。系统使用OAuth身份验证方法对用户授权完成登录过程。基于安卓的微博开发此系统的具体功能。这些Android应用程序的界面很漂亮,操作流畅。更重要的是,繁琐的接口和过多的广告被消除,这样用户就能够更加方便和更加顺利地操作这些应用程序。

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

1.介绍

近年来,智能手机的出现改变了手机的定义。电话不再只是一个沟通工具,而且也是人们沟通和日常生活的重要组成部分。各种应用程序为人们的生活增添了无限的乐趣。可以肯定的是,未来的网络将是移动终端。Android系统在电子市场上的应用越来越受欢迎,尤其是在智能手机市场。由于开源,一些开发工具是免费的,因此有大量的应用程序生成。这极大地激励了人们使用Android系统。此外,它为开发人员提供了一个非常方便的硬件平台,使他们可以花更少的精力来实现他们的想法。这使Android可以得到进一步的发展。

随着智能手机和Android系统越来越受欢迎,诸如听音乐,观看视频,tweeting和其他一些操作现在可以从计算机移动到手机。

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

2. Android架构

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

如图1所示,Android架构由四个层组成:Linux内核,库和Android运行时,应用程序框架和应用程序。

每层的下层封装,同时向上层提供呼叫接口。

2.1 应用程序

Android应用程序将附带一组核心应用程序,包括客户端,短信程序,日历,地图,浏览器,联系人和其他人。所有这些应用程序都是用Java开发的。

2.2 应用程序框架

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

2.3 库和Android运行时

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

Android系统库支持应用程序框架,它也是连接应用程序框架和Linux内核之间的重要链接。该系统库以C或C 语言开发。这些库也可以由Android系统中的不同组件使用。他们通过应用程序框架为开发人员提供服务。

2.4 Linux内核

Android内核提供的内核系统服务基于Linux 2.6内核,内部存储,进程管理,网络协议,底层驱动等核心服务都是基于Linux内核的。

3.实验方法

3.1 视频播放器

视频播放器是通过Eclipse平台实现的。为了开发Android应用程序,我们将安装一个Eclipse插件:Android开发工具(ADT)。一旦安装,下载Android SDK ,安装和配置SDK,然后我们可以开发一个视频播放器。

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

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

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

媒体播放器在运行时可大致分为两部分:客户端和服务器。它们在两个独立的进程中运行。 Binder之间使用它们来实现IPC通信。图3中的Mediaplayerservice是服务器端实现库。

媒体播放器调用Opencore 提供的媒体播放功能来实现视频文件播放,Opencore负责媒体文件格式解析,解码音频和视频数据,并输出媒体数据。 Opencore调用SurfaceFlinger接口实现视频数据的显示,并通过应用AudioFlinger接口实现音频数据的播放。

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

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

3.2 音频播放器

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

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

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

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

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

音乐回放模块收集从List模块发送的意图并对其进行分析,然后调用后台音乐服务来播放音频文件。 View组件为播放器提供一些基本功能,如播放,暂停,快进,快退,单播,随机播放等。该模块将在用户对组件进行操作后进行相应的逻辑分析。将根据分析的结果进行适当的反应和改变。音频播放器接口如图9所示。

3.3 新浪微博客户端

该系统的开发工具与视频播放器和音频播放器的开发工具相同,但除了这些工具之外,新浪开放平台还被应用于获取数据和写入数据。

在设计阶段,考虑整个系统的逻辑性和可扩展性。我们的系统分为四层,即UI层,逻辑层,微博接口层,网络接入层。图10是系统架构。

UI层负责显示系统的各种形式和各种形式的调用逻辑之间的协调。

逻辑层核心控制调度模块用于访问UI传输的数据,需要执行的任务包括调用微博接口,访问网络数据,返回消息,刷新UI等。

新浪微博接口层(新浪API 封装)提供各种接口访问开放平台新浪微博,并用于帮助系统访问数据和从新浪微博系统返回数据。

网络接入层(Sina API 封装)负责系统和服务器的网络连接和数据传输。

用户登录和授权通过调用新浪提供的页面进行处理,系统不做干预。然后,第三方应用可以在不知道用户帐户和密码的情况下访问用户的数据。

系统使用新浪微博的Android微博SDK来协助开发,它已经与开源Java OAuth 身份验证包集成:Signpost,开发人员必须在新浪微博开发者平台注册为开发人员,并获得相应的应用程序Key和App Secret完成指导注册。

验证需要在新浪微博SDK与服务器交互之前完成。 SDK提供了一个微博类,当启动程序时,需要执行以下代码来创建一个微博对象,并设置App Key,App Secret和URL。

weibo = Weibo.getInstance();

//创建微博对象

weibo.setupConsumerConfig(Consumer.consumerKey,Consumer.consumerSecret);

//设置应用程序键,应用程序秘密

weibo.setRedirectUrl(Consumer.redirectUrl);

//设置重定向网址

weibo.authorize(activity,new AuthDialogListenerImpl(activity));

执行上述代码后,将出现登录界面,输入用户名和密码,然后点击登录按钮。如果是首次登录,将显示“授权”页面。用户登录后,主屏幕将显示。

本系统开发的具体功能是基于Android微博SDK,调用其包装类来完成相应的任务。

例如,主界面分为三个部分:顶部是工具栏,中间区域是ListView,底部是按钮栏。微博列表是在主界面的中间部分,通过ListView显示。只要微博数据从服务端获得,就会直接通

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[138774],资料为PDF文档或Word文档,PDF文档可免费转换为Word

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

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