`
自动发帖器
  • 浏览: 2191 次
  • 性别: 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开发学习笔记 #### Button按钮的实现与交互 在Android开发中,`Button`控件是最常用的用户界面元素之一,用于触发特定的操作或事件。本文档将详细讲解如何创建并自定义一个简单的按钮,并设置点击事件...

    android 开发笔记

    "Android开发笔记"是由real6410公司为开发者提供的一份宝贵的资源,特别针对real6410开发板进行优化,旨在帮助开发者快速提升Android应用开发技能。这份资料包含了从基础知识到实战经验的全方位指导。 首先,"read ...

    Android驱动开发笔记

    ### Android驱动开发笔记概览 #### 1. JDK环境配置 在Android驱动开发过程中,通常需要一个良好的开发环境来支持项目的进行。文档中的片段显示了如何设置JDK(Java Development Kit)环境变量。这部分内容涉及到的...

    android 我的笔记 源码

    【Android 源码分析与学习笔记】 在深入探索 Android 开发的过程中,源码阅读是提升技术水平的关键步骤。Android 源码包含了操作系统层面、框架层以及应用开发接口等各个层次的实现细节,有助于开发者理解系统行为...

    Android开发笔记全集

    这个压缩包包含的文件名为“Android开发笔记”,暗示着它可能是一个系列的PDF文档或者Markdown格式的学习资料,详细记录了Android开发的各个阶段和细节。 Android开发是一个广泛的领域,包括基础理论、编程语言、UI...

    黑马Android培训笔记

    SDK(Software Development Kit)是Android开发的重要组成部分,包含各种库、工具和文档。AVD(Android Virtual Device)用于模拟Android设备。笔记将阐述如何下载和管理SDK,以及创建和使用AVD进行测试。 四、UI...

    上万网友力荐的30份Android移动开发技术文档

    从提供的部分内容来看,文档涵盖了Google Android SDK开发范例、企业级Android开发电子书、Android开发教程笔记、游戏开发实战、开发帮助手册以及高级编程指南等。这些文档内容丰富,形式多样,从基础入门到深入学习...

    android资料文档

    4. `android文档.txt`: 这是一个文本文件,很可能是文档的核心部分,包含文字描述、代码示例或者教程步骤。由于没有实际的内容可供查看,我们无法确定具体涵盖的主题,但根据标题和标签,我们可以推测它会涉及...

    Android学习笔记1

    从给定的文件信息来看,这些内容主要是Android开发的学习笔记,涵盖了从基础控件的添加、布局的设置、样式主题的调整到Activity生命周期的管理等多方面的知识点。以下是对文件内容的具体分析: 1. 添加TextView控件...

    Android学习笔记--Binder

    【Android学习笔记--Binder】 Binder是Android系统中的核心组件,它是Android系统实现进程间通信(IPC,Inter-Process Communication)的主要方式。Binder机制允许不同进程的组件之间进行数据交换和功能调用,就像...

    Android_学习笔记

    ### Android学习笔记——从HelloWorld开始 #### 一、Google的Android SDK介绍 自从Google发布了Android SDK以来,这款开源移动操作系统迅速吸引了众多开发者的关注。Android SDK为开发者提供了丰富的工具和API,...

    Android零基础开发教程笔记.doc

    《Android开发教程笔记完全版》是一份面向初学者的详细指南,旨在教授基本的Android编程技能,并逐步引导读者掌握高级的Android应用程序开发概念。这份文档首先介绍了开放手机联盟(Open Handset Alliance,简称OHA...

    Android+学习笔记

    本文档是一份详实的Android学习笔记,旨在帮助初学者快速入门Android开发。 #### 二、环境搭建与HelloWorld案例分析 **1. SDK下载与安装** - **下载**:访问Android官方网站或其他可信渠道下载Android SDK。 - **...

    Android笔记本小程序源码

    【Android笔记本小程序源码】是一个面向Android平台的项目,它为用户提供了一个轻量级的笔记应用体验。这个小程序集成了登录注销功能,允许用户安全地管理自己的笔记。它还涉及到了数据库连接技术,用于存储和检索...

    android开发笔记2

    标题“android开发笔记2”表明这是一系列笔记的第二部分,意味着它可能建立在前一版的基础之上,提供更深入或进阶的Android开发知识。对于初学者,这种连续的学习资源能构建完整的知识体系;对于有经验的开发者,它...

    Android World文档阅读器(文字,图片,表格)

    Android World文档阅读器是一款专为Android平台设计的应用程序,它具备强大的文档查看功能,能够处理包含文字、图片和表格的多种格式文档。这款应用旨在提供一个便捷、高效的途径,让用户在移动设备上轻松查看和管理...

    ADB笔记1 android技术文档.doc

    在Android开发过程中,Android Debug Bridge (ADB)是一个至关重要的工具,它允许开发者与模拟器或连接的Android设备进行通信。ADB作为一个客户端-服务器程序,由三个主要组件组成: 1. **客户端**:客户端运行在...

Global site tag (gtag.js) - Google Analytics