Android 新手入门之剖析 Android 程序结构
2010-03-23 04:56:00 来源:WEB开发网剖析Android程序(Anatomy of an Android Application)
Android程序由4个板块构成(There are four building blocks to an Android application: )
Acitvity用户界面管理器 (Acitvity)
消息收发器 (Intent Receiver)
服务对象(Service)
内容提供(Content Provider)
不是每个程序都需要有着全部4个部分,但是你的程序将被包含这些部分(Not every application needs to have all four, but your application will be written with some combination of these.)
你决定使用这些组件就需要在程序中例举出来在AndroidManifest.xml文件中,这是一个XML文件声明组件和其他能力请求 (Once you have decided what components you need for your application, you should list them in a file called AndroidManifest.xml. This is an XML file where you declare the components of your application and what their capabilities and requirements are)
Acitvity用户界面管理器 (Acitvity)
Activities大多数由4个Android板块构成,一个Activity通常由一个屏幕在你的程序中,每个Activity实现一个单独的类扩展Activity积累。你的类将显示用户界面包含Views和相应时间,大多数程序由多个屏幕构成。举个例子,一个文本消息程序可以由第一个屏幕显示一个列表连接着发送消息,第二个屏幕写入信息给选择的联系人,其他屏幕处理老的消息或改变设置。每个屏幕将由一个Avtivity实现。移动到其他屏幕显示一个新的Activity。在大多数情况下一个Activity可以返回上一个Activity的值,举个例子一个Activity能让用户选择一个照片将返回选择照片给调用者。(Activities are the most common of the four Android building blocks. An activity is usually a single screen in your application. Each activity is implemented as a single class that extends the Activity base class. Your class will display a user interface composed of Views and respond to events. Most applications consist of multiple screens. For example, a text messaging application might have one screen that shows a list of contacts to send messages to, a second screen to write the message to the chosen contact, and other screens to review old
- ››Android 当修改一些代码时,使用什么编译命令可以最...
- ››Android 如何添加一个apk使模拟器和真机都编译进去...
- ››Android 修改Camera拍照的默认保存路径
- ››Android 如何修改默认输入法
- ››android开发中finish()和System.exit(0)的区别
- ››Android手势识别简单封装类
- ››android中查看项目数字证书的两种方法
- ››Android中获取IMEI码的办法
- ››android 相机报错 setParameters failed
- ››Android重启运用程序的代码
- ››Android为ListView的Item设置不同的布局
- ››android bitmap与base64字符串的互相转换
更多精彩
赞助商链接