HOW THIS BOOK IS STRUCTURED
本书结构
This book is structured in a logical sequence to help readers of different development backgrounds learn how to write advanced Android applications.
There’s no requirement to read each chapter sequentially , but several of the sample projects are developed over the course of several chapters, adding new functionality and other enhancements at each stage .
本书的结构按照逻辑顺序排列,以帮助不同开发背景的读者学习如何开发高级的Android应用。本书不要求读者循序阅读每个章节,但为其中几个章节开发的演示项目很具价值,在每一阶段添加新的功能和其他功能上的增强。
Experienced mobile developers with a working Android development environment can skim the first two chapters — which are an introduction to mobile development and instructions for creating your development environment — and dive in at Chapters 3 to 7. These cover the fundamentals of Android development, so it’s important to have a solid understanding of the concepts they describe.
有用Android开发环境经验的移动开发者可以掠过介绍移动开发和创建开发环境的第1、2章,直接进入第3到7章。第3到第7章覆盖了基本的Android开发只是,对其中所描述的概念有个可靠的理解是后续进阶的基础。
With this covered, you can move on to the remaining chapters, which look at maps, location-based services, background applications, and more advanced topics such as hardware interaction and networking.
拥有了第3到7章的知识,你可以进入后续章节,关注地图,本地服务,后台应用和更多高级主题例如硬件交互和网络。
WHAT YOU NEED TO USE THIS BOOK
本书使用须知
To use the code samples in this book, you will need to create an Android development environment by downloading the Android SDK, developer tools, and the Java development kit. You may also wish to download and install Eclipse and the Android Developer Tool plug-in to ease your development, but neither is a requirement.
使用本书中的示例代码,你需要通过下载Android SDK、开发工具和 JDK来建立一个Android开发环境。你还需要下载并安装Eclipse和Android的开发插件(ADT)好方便你的开发,虽然这两个都不是必须的。
Android development is supported in Windows, Mac OS, and Linux, with the SDK available from the Android web site.
You do not need an Android device to use this book or develop Android applications.
Android针对Windows、MacOS和Linux提供了不同的SDK,可以在Android的网站下载。
Chapter 2 outlines these requirements in more detail as well as describing where to download and how to install each component.
在第2章中以上这些要求会更加详细,会告诉读者去哪里下载及每个软件如何安装。
CONVENTIONS
约定
To help you get the most from the text and keep track of what’s happening, I’ve used various conventions throughout the book.
为了帮助你从文中收获甚多并保持对书中内容的痕迹追踪,我将在书中贯穿使用以下约定。
As for styles in the text:
像一下这样的文本样式
? I show URLs and code within the text like so: persistence.properties.
我对文中的URL和程序代码用这样的样式:persistence.properties。
? To help readability, class names in text are often represented using a regular font but capitalized like so:
为了便于阅读,类名称经常会使用有规律的大写字体比如:
Content Provider
? I present code in two different ways:
我用两种不同的方法展示程序代码:
I use a monofont type with no highlighting for most code examples.
I use bold highlighting to emphasize code that’s particularly important
in the present context.
? In some code samples, you’ll see lines marked as follows:
在一些代码示例中,你将看到像下面这样用线标记的:
[ ... previous code goes here ... ]
或者
[ ... implement something here ... ]
This represents an instruction to replace the entire line (including the square brackets ) with
actual code, either from a previous code snippet in the former case, or your own
implementation in the latter.
这表示用实际程序代码替换线(包括方括号)的用法说明,可以是先前的样板代码片段或你自己的代码。
? To keep the code sample reasonably concise , I have not always included every import statement required in the code samples. The downloadable code samples described below include
all the required import statements.
为了保持实例代码适度简洁,我将不会经常把需要的import语句放在实例代码中。下载的实例代码会包含所有需要的import语句。