`
自动发帖器
  • 浏览: 2144 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

Android中文文档笔记①

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

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处理的各种数据类型。
分享到:
评论
2 楼 自动发帖器 2008-12-16  
你个色狼
1 楼 wangdi 2008-12-16  
我只想顶一*下而已。。

相关推荐

    Android部分chm笔记文档

    Android部分chm笔记文档

    Android开发学习笔记

    Android 开发学习笔记,学习android的好资料

    android 开发笔记

    由real6410公司提供的android开发笔记 针对real6410开发板,可迅速提高android开发 技能

    ADB笔记1 android技术文档.doc

    ADB笔记1 android技术文档.doc Android Debug Brige原理介绍

    Android个人笔记本

    Android课程设计:该文档时一个基于Android的个人笔记本的小程序

    Android学习文档

    Android学习笔记,供学习参考

    新版Android开发教程笔记

    新版Android开发教程笔记,一共为十三章,为PDF格式文档,总结了android编程过程中遇到的一些问题及解决办法,另外介绍了编程技巧。非常适合初学者,对于熟练的编程人员也可作参考。内容非常详实,并有详细的目录!

    Android学习笔记.pdf

    包括环境搭建教程、创建模拟器、新建helloworld程序、电话拨号器、软件部署到模拟器、短信发送器、线性布局、相对布局、日志、activity、Android进程线程及优先级、Android UI线程阻塞及优化、广播接受者、Service...

    Android开发笔记——UI基础编程

    Android开发笔记,UI基础编程,PDF文档。

    Android学习笔记1

    androdi学习笔记1,初步认识android开发,学习路上的总结。

    Android学习笔记--Binder

    android的binder机制提供一种进程间通信的方法,使不同一个进程可以以类似远程过程调用的形式调用另一个进程所提供的功能。binder机制在Java环境和C/C++环境都有提供。

    Android开发教程笔记.doc

    Android开发教程笔记

    Android自学笔记

    Android自学笔记,写的很浅,后续还会继续学习并对其进行修改完整

    Android新手开发教程+笔记 pdf

    Android新手开发教程 pdf及学习笔记,Android 编程基础教程,涉及什么是开放手机联盟--Open HandsetAlliance,Android手机新概念,Android开发背景,Android盈利模式,Android的不足,Android带来的影响,Android...

    android开发学习笔记

    本资料是我学习时候记录下的点点滴滴,包括网上其它博客的文章,加以总结记录于此,供android开发者借鉴。 Android开发交流群 [color=red][size=x-large]169022773[/size][/color] 本人做android也有两年了,主要做...

    android Developer 开发教程笔记--新版学习

    android Developer 开发教程笔记,可以学习android SDK中的英文文档!

    android命令行笔记

    新手学习android时,对命令行的常用命令特意作了笔记,贡献给大家。 主要包括: 查看avd列表 启动模拟器 安装/卸载程序 启动/关闭ADB服务 查询当前模拟器/设备的实例 列出目标设备id 创建模拟器 进入adb shell 查看...

    Android笔记本小程序源码

    Android笔记本小程序源码,实现了登陆登出,数据库链接和插入图片但并不是富文本编辑,保存文件是用数据库和本地文档一起保存的

    Android开发教程笔记完全版

    Android开发教程笔记完全版,是一份很好的新入门者选择的好资料

    android 初学者整理的开发笔记

    本资源文档是本人学习android过程中从网上网络的一些资料,个别是本人的心得笔记,其中也有部分源码。要感谢csdn广大的博友的无私奉献,这里不再一一列出。由于时间问题,文章整理的比较杂。但里面的好多内容还是...

Global site tag (gtag.js) - Google Analytics