开发学院手机开发Android 开发 Android 新手入门之剖析 Android 程序结构 阅读

Android 新手入门之剖析 Android 程序结构

 2010-03-23 04:56:00 来源:WEB开发网   
核心提示:剖析Android程序结构-Android新手入门剖析Android程序(Anatomy of an Android Application)Android程序由4个板块构成(There are four building blocks to an Android application: )Acitvity用户界面管


剖析Android程序(Anatomy of an Android Application)

Android程序由4个板块构成(There are four building blocks to an Android application: )

Acitvity用户界面管理器 (Acitvity)

消息收发器 (Intent Receiver)


内容提供(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

1 2  下一页

Tags:Android 新手入门 剖析

编辑录入:coldstar [复制链接] [打 印]