看到你理解我的理解错了的地方给个回复,谢谢。

In Android, user interfaces are composed of hierarchies of classes called Views. A View is simply a drawable object, such as a radio button, an animation, or (in our case) a text label. The specific name for the View subclass that handles text is simply TextView.

在Android中,用户界面是由View来组成的。一个View就是一个drawable的对象,比如一个单选按钮,一个动画,或者是一个文字标签。View子类型中用来显示文字 类是TextView。

Android provides an alternate UI construction model: XML-based layout files.

Android提供了一个替代创建用户界面的模式:基于XML的XML Layout文件。

the general structure of an Android XML layout file is simple. It's a tree of tags, where each tag is the name of a View class.

一般的Android XML Layout 文件 结构非常简单。它由树形的标记组成,每一个标记都是一个View类。

So, that's what the XML layout looks like, but where do you put it? Under the res/ directory in your project. The "res" is short for "resources" and that directory contains all the non-code assets that your application requires. This includes things like images, localized strings, and XML layout files.

这就是XML layout的内容,但是该将它放在那里呢?在项目的res/ 目录中。这个"res"是对"resources"的缩写,这个目录中存放项目中所有不是代码的资源或文件。包括:图片,本地字符串,XML layout文件。

A project's R.java file is an index into all the resources defined in the file. You use this class in your source code as a sort of short-hand way to refer to resources you've included in your project. This is particularly powerful with the code-completion features of IDEs like Eclipse because it lets you quickly and interactively locate the specific reference you're looking for.

项目中的R.java文件是对文件中所有定义资源的索引。可以用最简单的方式在代码中使用项目中定义的资源。利用Eclipse的代码提示功能可以更快找到需要的内容。

There are four building blocks to an Android application:
Activity
Intent Receiver
Service
Content Provider

在Android应用程序中有四个构建块:
活动
活动内容接受器(意图接收器?)
服务
内容提供器


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.

Activity是Android构造块中最基本的一种,在应用中,一个activity通常就是一个单独的屏幕。 每一个activity都被实现为一个独立的类,并且继承于Activity这个基类。这个activity类将会显示 由几个Views控件组成的用户接口,并对事件做出响应。大部份的应用都会包含多个的屏幕。

Android uses a special class called an Intent to move from screen to screen. An intent describes what an application wants done. The two most important parts of the intent data structure are the action and the data to act upon. Typical values for action are MAIN (the front door of the activity), VIEW, PICK, EDIT, etc.

There is a related class called an IntentFilter. While an intent is effectively a request to do something, an intent filter is a description of what intents an activity (or intent receiver, see below) is capable of handling. An activity that is able to display contact information for a person would publish an IntentFilter that said that it knows how to handle the action VIEW when applied to data representing a person. Activities publish their IntentFilters in the AndroidManifest.xml file.

与之有关系的一个类叫IntentFilter。相对于intent是一个有效的做某事的请求,一个intent filter则用于 描述一个activity(或者Intent Receiver)能够操作哪些intent。一个activity如果要显示一个人的联系方式时, 需要声明一个IntentFilter,这个IntentFilter要知道怎么去处理VIEW动作和表示一个人的URI。IntentFilter需 要在AndroidManifest.xml中定义。

You can use an IntentReceiver when you want code in your application to execute in reaction to an external event

A Service is code that is long-lived and runs without a UI.

一个Service是一段长生命周期的,没有用户界面的程序。

Applications can store their data in files, an SQLite database, or any other mechanism that makes sense. A content provider, however, is useful if you want your application's data to be shared with other applications. A content provider is a class that implements a standard set of methods to let other applications store and retrieve the type of data that is handled by that content provider.

应用程序能够将它们的数据保存到文件中、SQL数据库中,甚至是任何有效的设备中。当你想将你的应用数据与其它的 应用共享时,Content Provider将会很有用。一个Content Provider类实现了一组标准的方法,从而能够让其它的应用 保存或读取此Content Provider处理的各种数据类型。

更多相关文章

  1. Android手机中紧急号码的定制
  2. Android(安卓)UI编辑器 Unhandled event loop exception解决方法
  3. android TextView 如何实现消息滚动
  4. Android(安卓)Studio加载老旧项目会遇到的问题
  5. android 锁屏
  6. Android文件拷贝
  7. android使用finish()和System.exit()退出应用程序的理解
  8. android Intent类
  9. NPM 和webpack 的基础使用

随机推荐

  1. android MediaPlayer SurfaceView 网络视
  2. Andriod studio编译问题:org.gradle.proce
  3. 简单的android Q 摄像头预览操作
  4. Android(安卓)实现手机震动功能
  5. Android自学笔记之短信发送器
  6. Android(安卓)使用decodeFile方法加载手
  7. android 代码中设置字体大小
  8. 打包错误:`Error:Execution failed for ta
  9. Android(安卓)获取通讯录联系人
  10. android 强制开启 GPS