基于Android 的垃圾短信过滤器设计与实现外文翻译资料

 2022-12-16 20:02:50

外文翻译

题 目 Application Development Research

Based on Android Platform

作 者 Shao Guo-Hong

发表时间_____2014年_______

二O 一九 年 四 月 二十六 日

2014 7th International Conference on Intelligent Computation Technology and Automation

Application Development Research Based on Android Platform

SHAO Guo-hong

(1. Beijing Vocational College of Agriculture IT Department, 102442, China)

Abstract—Android is an open and free operating system based on Linux, which is mainly used for mobile terminals, such as smart phones and panel computer. It is developed by Open Handset Alliance composed of more than 30 technology companies and mobile phone companies. Android tries to allow users experience the best service quality, and allow developers get a more open level for more convenient software developing. Thus mobile applications with more convenient functions can be developed via Android. This paper firtsly presents the architecture of Android platform, including the classes and methods in developing. Then we takes audio/video file procurement as an example to introduce the Android program design and development, including classes application, program design, development and analysis.

Keywords-Android; Linux; OpenCORE; MediaRecorder Class

1 INTRODUCTION

The word 'Android' is intended to refer to robot, however, we now know that it is the open source mobile phone operating system launched by Google. Android is based on Linux platform, and composed of operating system, middleware, user interface and application software, which is called as the first truly open mobile software for mobile terminals. As an important part of Google mobile Internet strategy, Android will further promote the Google enterprise target achievement of 'provide information for everyone at any time in any place' .

Android is developed by Open Handset Alliance composed of more than 30 technology companies and mobile phone companies including Google, HTC, T-Mobile, Qualcomm, Motorola, Samsung, China Mobile and LG. Open Handset Alliance states that Android platform can promote the mobile devices innovation to allow users experience the best service quality. Also, developers will get a new open level for more convenient synergistic effect, ensuring the development speed of new mobile devices. Therefore, Android is the first complete, open and free mobile phone platform.

Android system has the following 5 characteristics:

Open: Android is developed by more than 30 companies in Open Handset Alliance, thus the cooperation among Google, operators, equipment manufacturers and developers try to establish a standardized and open mobile phone software platform, and form an open ecosystem in the mobile field.

There are no boundaries among applications on Android platform, thus they access the core mobile device functionality via the standard API.

Applications can also declare their functions to make them available for other applications.

Applications on the mobile devices are equal, so they can be replaced or extended, even as the core components such as dialing program or main screen.

Applications can be easily embedded into HTML, JavaScript and the style sheet, and network content can be displayed via WebView.

Android is a complete multi-task environment, thus applications can run paralleled. When running in background, they can generate notifications to attract attentions.

2 ANDROID PLATFORM ARCHITECTURE

The Android architecture can be divided into four layers, which from high to low are application layer, application framework layer, system operating library layer and Linux kernel layer, as shown in Figure 1 .

Figure 1 Android Platform Architecture

  1. Application Layer

Applications are programs written by Java language and run in the virtual machine. In fact, Google bundle some core applications into the Android system, such as E-mail client, short message, calendar, map, browser, contacts management and other programs.

  1. Application Framework Layer

Application framework layer refers to the API frameworks of the core applications released by Google. Developers can also apply these frameworks to develop their own applications, which can simplify the program architecture design. But they must comply with the development principles.

Android provides the following components:

Rich and scalable View: can be applied to construct application programs, including List, Grid, Text Box, Button and embedded Web browser.

Content Providers: it allows an application program to access the data of another application or share its data.Resource Manager: it provides access to non-codes resources, such as local character strings, figures and Layout files.

Notification Manager: applications can show their custom notifications in the status bar.

Activity Manager: manage the life cycle of application programs, and also provide the commonly used navigation back function.

Window Manager: manage all the window programs.

Package Manager: programs management of the Android system.

C. System Operating Library Layer

When applying the Android application framework, Android will support the components via some C/C libraries to make them service us better.

Bionic system C library: it is the C language standard library, and also the bottom library of the system, which is invoked by Linux system.

Media Framework: based on the PacketVideo, OpenCORE to support the playerback and recording of audio and video in multiple formats, such as MPEG4, MP3, AAC, AMR, JPG, PNG.

SGL: 2D graphics engine library.

SSL: located between TCP/IP protocol and other application protocols to support data communication.

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


外文翻译

题 目 基于Android平台的应用开发研究

作 者 Shao Guo-Hong

发表时间_____2014年_______

二O 一九 年 四 月 二十六 日

2014年第七届智能计算技术与自动化国际会议

基于Android平台的应用开发研究

邵国宏

(1.北京农业职业学院信息技术系,102442,中国)

摘要:Android是一个基于Linux的开源的免费的操作系统,主要用于智能手机、平板电脑等移动终端。它是由30多家科技公司和手机公司组成的开放式手机联盟开发的。Android试图让用户体验到最佳的服务质量,并允许开发人员获得更开放的级别,以便更方便地进行软件开发。因此,可以通过Android开发具有更方便功能的移动应用程序。本文首先介绍了Android平台的体系结构,包括开发中的类和方法。然后以音频/视频文件采购为例,介绍了Android程序的设计与开发,包括类的应用、程序的设计、开发和分析。

关键词:安卓系统、Linux、OpenCORE、MediaRecorder类

1 介绍

“Android”一词本意是指机器人,但我们现在知道它是由谷歌推出的开源的手机操作系统。Android系统是基于Linux平台,由操作系统、中间件、用户界面和应用软件这几个部分所组成的,Android系统被称为是第一个真正面向移动终端开放的移动软件。Android作为谷歌移动互联网战略的重要组成部分,将会进一步推动谷歌公司“随时随地为大家提供信息”的目标实现。

Android是由谷歌、HTC、T-Mobile、高通、摩托罗拉、三星、中国移动、LG等30多家科技公司、手机公司等一些公司企业所组成的开放手机联盟开发的。开放手机联盟表示,Android平台的存在可以促进移动设备的创新,让用户能够体验到最好的服务质量。同时,开发人员将获得一个新的开放级别,以更方便的协同效应,确保新的移动设备的开发速度。因此,Android是第一个完整、开放、免费的手机平台。2007年11月5日,谷歌公司正式向外界展示了这款名为Android的操作系统,并且在这一天谷歌宣布建立一个全球性的联盟组织,这个联盟组织是由34家手机制造商、软件开发商、电信运营商以及芯片制造商共同组成的,并且与84家硬件制造商、软件开发商及电信营运商组成开放手持设备联盟(Open Handset Alliance)来共同研发改良的Android系统,这一联盟将支持谷歌发布的手机操作系统以及应用软件,Google以Apache免费开源许可证的授权方式,发布了Android的源代码。

Android系统有以下5个特点:

开放:Android是由开放手机联盟30多家公司共同开发的,谷歌与运营商、设备制造商、开发者等多方合作,试图建立一个标准化、开放的手机软件平台,在移动领域形成一个开放的生态系统。

Android平台上的应用程序之间没有边界,因此它们通过标准API访问核心移动设备功能。

应用程序还可以声明它们的函数,使它们对其他应用程序可用。

移动设备上的应用程序是平等的,因此它们可以被替换或扩展,甚至可以作为核心组件,如拨号程序或主屏幕。

应用程序可以很容易地嵌入到HTML、JavaScript和样式表中,并且网络内容可以通过WebView显示。

Android是一个完整的多任务环境,因此应用程序可以并行运行。当在后台运行时,它们可以生成通知来吸引注意。

Android平台具有以下几个特点:

开放性

在有利条件上,开放性是Android平台最为主要的特征之一,其包容性非常广泛,可以容纳各类移动终端厂商的相互合作,互利共赢。这一特征赋予了该平台更为优秀的良好资源,再加上使用者的增加与相关功能的完善,该平台最终会迎来十分可观的前景。

从Android平台未来的发展角度考虑,开放性能够帮助其获得更加有利的资源渠道,吸引厂商与消费者的好感度,而站在后者的利益角度来考虑,如此海量的软件资源才是真正使消费者感到满意的地方。同时,平台的对外开放也会使内部的竞争压力逐渐变大,从而进一步促使消费者可以通过更为优惠的价格购买到合适的手机。

丰富的硬件

该优势也是建立在平台开放性特征的基础之上的,大部分的移动终端厂商会在开放的市场竞争中研发出多款富有心意、贴近消费者需求的产品。各类不同手机虽然在操作按钮等功能的运用上各不相同,但手机中的各项数据却可以时刻保持同步更新,软件的使用也并无冲突,例如,若消费者选用新买的苹果iPhone取代原来诺基亚Symbian风格手机,那么原来手机中的联系人等相关信息均可以被转移到iPhone上,同时在Symbian中仍然需要的软件在新手机上依旧可以运用自如。

方便开发

Android平台上相对自由、包容广阔的竞争模式,为第三方创造了一种十分有利的发展条件,从而促进了各类别出心裁的软件功能被大量地发明与使用,满足消费者的各项需求。但其也有一定的弊端,由于缺少相对约束的规章制度,网站上不良内容的出现也日渐频繁,这需要Android进一步的思考与完善。

Google应用

经过了十年的发展改进,Google在互联网领域上已经有了十分显赫的地位,从一开始仅包括搜索查找这一功能,到现在其覆盖范围已包含了整个互联网系统,像邮件、地图以及搜索等不同的功能,建立了使用者与互联网沟通的桥梁,诸如此类的Google便捷功能服务,在Android平台都能完美地展现出来。

2 ANDROID平台架构

Android系统的架构普遍是由最上面的应用层,第二层的应用框架层,第三层的系统运行库层以及最底层的Linux内核层四层构成。如图1所示。

图1 Android平台架构

  1. 应用程序层

应用程序是用Java语言编写并在虚拟机中运行的程序。事实上,谷歌将一些核心应用捆绑到Android系统中,如电子邮件客户端、短消息、日历、地图、浏览器、联系人管理等程序。

2)应用程序框架层

其核心应用程序所使用的API架构,开发工作者们能够进行完全访问。API架构极大程度上使得了组件的重用变得简洁高效,即所有的应用程序都能够发布属于它自己的功能块,而且别的应用程序同样能够在遵守架构安全性的前提下使用其发布的功能块。类似的,这种应用程序的重用机制极大提高了用户更替程序中的组件的灵活性。Android提供了以下组件:

富扩展性视图:可用于构建应用程序,包括列表、网格、文本框、按钮和嵌入式Web浏览器。

内容提供者:它允许应用程序访问另一个应用程序的数据或共享其数据。资源管理器:它提供对非代码资源的访问,如本地字符串、图形和布局文件。

通知管理器:应用程序可以在状态栏中显示自定义通知。

活动管理器:管理应用程序的生命周期,并提供常用的导航返回功能。

窗口管理器:管理所有窗口程序。

包管理器:Android系统的程序管理。

3)系统操作库层

Android 包含一些C/C 库,这些库能被Android系统中不同的组件使用。它们通过 Android 应用程序框架为开发者提供服务。以下是一些核心库:

系统 C 库:一个从BSD继承来的标准C系统函数库 Libc ), 它是专门为基于Embedded linux的设备定制的。

媒体库:基于PacketVideo OpenCORE;该库支持多种常用的音频、视频格式回放和录制,同时支持静态图像文件。编码格式包括MPEG4, H.264, MP3, AAC, AMR, JPG, PNG 。

Surface Manager:对显示子系统的管理,并且为多个应用程序提 供了2D和3D图层的无缝融合。

LibWebCore:一个最新的web浏览器引擎用,支持Android浏览器和一个可嵌入的web视图。

CGL:二维图形引擎库。

SSL:位于TCP/IP协议和其他应用程序协议之间,支持数据通信。

OpenGL ES1.0:支持3D效果。

SQLite:关系数据库。

Webkit::Web浏览器引擎。

自由类型:位图和向量。

所有的Java程序都运行在Dalvik虚拟机上。与PC类似,每个Android应用程序都有自己的进程,Dalvik虚拟机只执行可执行文件“.dex”。因此,在编译Java程序之后,还需要通过SDK中的dx工具将它们传输到“.dex”,以便在虚拟机上运行。

谷歌于2007年底正式发布Android ADK, Dalvik虚拟机首次进入人们的视野。它对内存的高效利用和在低速CPU中的高性能确实引人注目。Android系统可以简单地完成进程隔离和线程管理。每个Android应用程序对应于底部的一个独立的Dalvik虚拟机实例,它的代码在虚拟机解释中执行。综上所述,Dalvik虚拟机具有以下特点:

专有文件格式“.dex”:dex是专有文件格式。它放弃了。类文件,并应用新格式提高文件的解析和搜索速度,同时支持新的操作代码。

dex文件优化:dex文件结构紧凑,优化后进一步提高运行性能,包括调整所有字段的字节序列,验证“.dex”文件中的所有类,优化某些特定类和方法的操作代码。

寄存器:与基于栈的虚拟机相比,基于寄存器的虚拟机在硬件和通用性上都较弱,但代码执行效率较高。

应用程序、虚拟机实例、进程:每个Android应用程序都运行在Dalvik虚拟机实例中,每个虚拟机实例都是独立的进程空间。线程机制、内存分配和管理、互斥锁的实现都依赖于底层操作系统。每个Android应用程序线程对应一个Linux线程,因此虚拟机可以更加依赖于虚拟机的线程调度和管理机制。不同的应用程序运行在不同的线程空间,不同的Linux用户运行来自不同资源的应用程序,最大限度地保护了应用程序的安全性和独立运行。

4)Linux内核层

安卓系统尽管是在在Linux kernel上工作的,但它却与GNU/Linux有着显著的不同。原因便是在常用的GNU/Linux 里所支持的功能,绝大多数Android 却没有给予相应的技术支撑,像Cairo、FFmpeg及Glibc等等却都被Android无情地去除掉了。而Android却又通过Bionic 来代替Glibc、通过Skia 来代替Cairo、通过opencore来代替FFmpeg等来补充自己的功能。除此之外,Android 想要做自己的商业应用,却又无奈得去除被GNU GPL授权证所限制的范围,如Android将驱动程序转到 Userspace,以此就可以使得Linux driver 和 Linux kernel完全分离。Bionic/Libc/Kernel/ 不是标准的Kernel header files。Android 的 Kernel header 是采用相应的工具在 Linux Kernel header 里挖掘出来的,以此来保存常数、数据结构和宏等关键信息。

Android 的 Linux kernel控制主要有:安全(Security),存储器管理(Memory Management),程序管理(Process Management),网络堆栈(Network Stack),驱动程序模型(Driver Model)等。如果想要下载Android的原码,那么就得提前装上他的搭建软件 Repo(用来协助Git工作的一个工具)对源码进行初始化。

Android的核心系统服务基于Linux 2.5内核,包括安全、内存管理、进程管理、网络协议栈、驱动模型等。Linux内核也是硬件和软件堆栈之间的抽象层。

Android更需要的是与移动驱动相关的驱动,主要驱动如下:

显示驱动程序:基于Linux的帧缓冲驱动程序。

键盘驱动程序:输入设备的驱动程序,键盘。

闪存驱动器:基于MTD的闪存驱动器。

摄像头驱动程序:常用的基于Linux的视频驱动程序(v412)。

音频驱动程序:常用的高级Linux声音体系结构(ALSA)。

蓝牙驱动:无线传输:基于IEEE 802.15.1的无线传输技术。

WiFi驱动:基于IEEE 802.11。

绑定器IPC驱动程序:Android的一种特殊驱动程序,它有一个设备节点来提供进程之间的通信功能。

电源管理:如电池电量。

3 ANDROID程序设计和开发,用于音频/视频文件的采购

第2节提到OpenCORE是Android media framework的核心,所有的音频和视频文件的购买和播放都由OpenCORE完成。程序员可以开发媒体程序,如录制、播放、回放、视频会议和DirectShow流媒体。从宏观上看,OpenCore包括两个方面:

PVPlayer:提供媒体播放器功能,即音频、视频回放功能。

PVAuthor:提供流媒体录制功能,即音频、视频流、静态图形的采购功能。

PVPlayer和PVAuthor以SDK的形式提供给开发人员,在SDK之上可以构建许多应用程序和服务。移动终端通常应用于媒体应用,如媒体播放器、摄像机、视频、录像机等。实际上,OpenCORE包含了很多内容:从播放的角度来看,PVplayer的源输出是文件或网络媒体流,并汇聚到音频或视频的输出设备上,具有媒体流控制、文件

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


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

您需要先支付 30元 才能查看全部内容!立即支付

发小红书推广免费获取该资料资格。点击链接进入获取推广文案即可: Ai一键组稿 | 降AI率 | 降重复率 | 论文一键排版