没有合适的资源?快使用搜索试试~ 我知道了~
有关android技术英文文献翻译资料.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 78 浏览量
2022-01-21
18:39:39
上传
评论
收藏 63KB PDF 举报
温馨提示
试读
17页
有关android技术英文文献翻译资料.pdf
资源推荐
资源详情
资源评论
精品文档
精品文档
Application Fundamentals
Android applications are written in the Java programming language. The compiled Java code
—
along with any data and resource files required by the application
—
is bundled by the aapt tool
into an Android package, an archive file marked by an .apk suffix. This file is the vehicle for
distributing the application and installing it on mobile devices; it's the file users download to their
devices. All the code in a single .apk file is considered to be one application.
Android
应用基础:
Android
应用程序是通过
java
语言开发的,通过绑定一些应用所需要的东西,例如:编 译的
Java
代
码,加上数据和一些资源文件,使用一个
apt
的工具将所有的东西封装成一
个 an droid 包,这个文件的文件后缀是 .apk。这个文件是分发并安装应用程序到移动设备 的载体,是
用户获得该应用程序所需要的下载的文件。
Application Components A central feature of Android is that one application can make use of
elements of other applications (provided those applications permit it). For example, if your
application needs to display a scrolling list of images and another application has developed a
suitable scroller and made it available to others, you can call upon that scroller to do the work,
rather than develop your own. Your application doesn't incorporate the code of the other
application or link to it. Rather, it simply starts up that piece of the other application when the need
arises. For this to work, the system must be able to start an application process when any part of it
is needed, and instantiate the Java objects for that part. Therefore, unlike applications on most
other systems, Android applications don't have a single entry point for everything in the application
(no main() function, for example). Rather, they have essential components that the system can
instantiate and run as needed. There are four types of components:
Activities An activity presents a visual user interface for one focused endeavor the user can
undertake. For example, an activity might present a list of menu items users can choose from or it
might display photographs along with their captions. A text messaging application might have one
activity that shows a list of contacts to send messages to, a second activity to write the messageto
the chosen contact, and other activities to review old messagesor change settings. Though they
work together to form a cohesive user interface, each activity is independent of the others. Each
精品文档
精品文档
one is implemented as a subclass of the Activity base class. An application might consist of just
one activity or, like the text messaging application just mentioned, it may contain several. What the
activities are, and how many there are depends, of course, on the application and its design.
Typically, one of the activities is marked as the first one that should be presented to the user when
the application is launched. Moving from one activity to another is accomplished by having the
current activity start the next one. Android
有四大应用程序组件
Android
的一个很重要的中心特征就是一个应用程序能充分利用其他的应用程序的一些 组件(前提是被
允许的) 例如:如果的当前开发的应用需要一个滚动的列表去展示相 片并且当时其他的程序已经开发
了一个合适的滚动列表并且对其他人可用, 你可以调用 这个滚动的列表来完成你的工作而不是开发你
自己的。 你的应用不需要包含那个应用的 代码或来链接它。
相反,它只是简单的在你需要它是启动这部分的应用 为了实现这部分的功能, 当前系统必须能启动其
他应用程序进程的功能当那些部分它需 要时,并且为这部分的
java
对象初始化这个
java
对象。因此,
不想在其他系统中的应 用程序,
an droid
应用程序不需要一个单一的入口点(例如
:
没有
main
())
而是,提供 了实例化和运行所需的必备组件。
Android
有四大应用程序组件
1
:
activity
一个
Activity
基类是为展示可视化用户接口。 例如:一个
Activity
可以显示一个供用 户选择的菜
单列表,或者可以展示一些图片以及对应的说明。一个短信的应用有一个活 动显示发送消息的一系列的
联系人,第二个活动去编写信息文本去选择联系人,第三个 活动去查看以前的信息或修改一些设置。虽
然它们组成了一个内聚的用户界面,每一个 活动都和其他的的相互独立, 每一个都继承 Activity ,是
Activity
的子类。一个应用程序 可以只有一个
Activity
,但是也可以有多个,比如刚刚提到的文本应用。
每个程序的作 用,有多少个程序,取决于该应用的设计。
Services
A service doesn't have a visual user interface, but rather runs in the background for an indefinite
period of time. For example, a service might play background music as the user attends to other
matters, or it might fetch data over the network or calculate something and provide the result to
activities that need it. Each service extends the Service base class.
2
:
services
服务是
an droid
中一个在后台运行的应用程序,没有可视化的用户界面。
例如:你可以在使用一个用户程序的同时播放背景音乐。并且此时,播放音乐的代码就 不需要和用户交
互,因此可以作为一个服务来运行,并且使用用户服务的接口来实现音 乐的播放,暂停,等功能。对于
不用向用户展示用户界面的情况下,使用服务是一个理 想的选择。如同其他的组件一样,
services
运行
精品文档
精品文档
于应用程序进程的主线程内。所以它不 会对其他组件或用户界面有任何的妨碍, 他们一般会派生一个
新线程来执行一些时间消
耗型的任务。
Broadcast receivers
A broadcast receiver is a comp onent that does nothing but receive and react to broadcast announ
ceme nts. Many broadcasts orig in ate in system code
—
for example, announ ceme nts that the
time zone has changed, that the battery is low, that a picture has been taken, or that the user cha
nged a Ian guage prefere nee. Applicati ons can also in itiate broadcasts for example, to let other
applicati ons know that some data has bee n dow nl oaded to the device and is available for them
to use.
An applicati on can have any nu mber of broadcast receivers to resp ond to any announ ceme nts
it considers important. All receivers extend the BroadcastReceiver base class. Broadcast
receivers do not display a user in terface. However, they may start an activity in resp onse to the
information they receive, or they may use the NotificationManager to alert the user. Notifications
can get the user's attention in various ways —— flashing the backlight, vibrating the device, play
ing a sound, and so on. They typically place a persiste nt icon in the status bar, which users can
ope n to get the 3
:
Broadcast receiver
broadcast receiver
是?个与注
J -fe
收广播泄知唁 . ;:讥岀杠应处 - 貝
11
勺紺 . 牛
,.:
许多广播是由系统代码产生的一一 例如 迪知忙
K
收变?、匕池电竝攸 扪赛了「■帐 照片或者用
户改变了语言选项。应用程序也可以发起广播一一 例如 泄知
HP
应用 程序一些数据已经下载到设
备上并处于可用状态。
一个应用程序可以拥有任意数量的
broadcast receiver
以对口「土 &认为自安的
通知信息予以响应。所有的
receiver
均继承自
BroadcastReceiver
基类。
broadcast receiver
没什用户界面? - 然
nil V/fl'.l U
以丿
1
宓』 ?个
activity
来响应它们 攻密
L
的信息 戍咅地
ill
以使用
NotificationManager
来通知用户。通知可以用多种方
式来吸引用户的注意力一一闪动背光灯、震动设备、播放声音等等。通知一般是在
状态栏 上放一个持续的 图标用 户可以打开它并获取 消息。
Content providers
A content provider makes a specific set of the applicati on's data available to other applicati ons.
The data can be stored in the file system, in an SQLite database, or in any other manner that
剩余16页未读,继续阅读
资源评论
weixin_40895192
- 粉丝: 17
- 资源: 21万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 我的镜像包我的镜像包我的镜像包我的镜像包
- 简单高效率操作excel,不需要安装office,支持xls,xlsx,使用EPPlus打开电子表文件示例
- openEuler-22.03-LTS-SP3-aarch64-dvd.zip.002
- yolov3(1).caffemodel
- openEuler-22.03-LTS-SP3-aarch64-dvd.zip.003
- vue 动态配置路由案例.zip
- 音频生成-基于Pytorch+扩散模型实现音频生成-附项目源码-优质项目实战.zip
- c语言文件读写操作代码要点和难点.zip
- 基于Java作业管理系统设计(源代码+使用文档)
- 移动开发-微信小程序-汽车交易-商业应用-车源宝-小程序.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功