没有合适的资源?快使用搜索试试~ 我知道了~
首页Hello, Android 3rd Edition:Android开发新手入门经典
Hello, Android 3rd Edition:Android开发新手入门经典
3星 · 超过75%的资源 需积分: 3 5 下载量 4 浏览量
更新于2024-07-30
收藏 3.89MB PDF 举报
"《Hello, Android 3rd Edition》是一本专为Android平台开发者设计的全面而温和的入门指南,由经验丰富的作者编写。本书针对初学者特别优化,帮助读者迅速掌握Android应用程序开发的基本概念,并逐步引导他们将应用发布到Android Market。该书的特点在于其流畅的结构和广泛的覆盖范围,包括了如多点触控和OpenGL等在其他同类书籍中可能较少涉及的深入主题。 书中的读者评论反映出其深受开发者喜爱。Marko Gargenta,作为Marakana.com的CEO,赞赏本书的易学性和实用性,认为新手能够迅速进入Android开发的世界。Diego Torres Milano,一位Android专家和博主,表示这本书不仅对他的初次市场应用发布提供了有力支持,而且也适合进阶开发者。 Nathan Rapp,KMBurritoDesigns的创始人,强调了《Hello, Android》的包容性,它不仅对初学者友好,也能吸引资深开发者加入Android的迷人旅程。Michael Martin PMP,Google And Blog and Mobile Martin的创始人,明确指出这是一本介绍Google移动开发平台的必备读物。 《Hello, Android 3rd Edition》是一本权威且实用的教程,无论你是Android开发的初学者还是寻求进阶知识的开发者,都能从中收获宝贵的指导和实践经验,踏上Android开发的高速路。书中详尽的内容、精心设计的教程以及实战案例,使得学习者能够在轻松愉快的氛围中提升技能,掌握Android应用开发的核心技术,为自己的项目开发打下坚实基础。"
资源详情
资源推荐
Part I
Intr
oducing Android
From Library of Wow! eBook
Chapter 1
Quick Start
Android combines the ubiquity of cell phones, the excitement of open
source software, and the corporate backing of Google and other Open
Handset Alliance members like Motorola, HTC, Verizon, and AT&T. The
result is a mobile platform you can’t afford not to learn.
Luckily, getting started developing with Android is easy. You don’t even
need access to an Android phone—just a computer where you can
install the Android SDK and phone emulator.
In this chapter, I’ll show you how to get all the development tools
installed, and then we’ll jump right in and create a working applica-
tion: Android’s version of “Hello, World.”
1.1 Installing the Tools
The Android software development kit (SDK) works on Windows, Li
nux,
and
Mac OS X. The applications you cr eate, of course, can be deployed
on any Android devices.
Before you start coding, you need to install Java, an IDE, and the
Android SDK.
Java 5.0+
First you need a copy of Java. All the Android development tools requir
e
it, and programs you write will be using the Java language. JDK 5 or 6
is required.
It’s not enough to just have a runtime environment (JRE); you need the
full development kit. I recommend getting the latest Sun JDK SE 6.0
From Library of Wow! eBook
IN
STALLING THE TOOLS
18
update
from the Sun download site.
1
The 32-bit version seems to work
best (see the “32-bit vs. 64-bit” sidebar). Mac OS X users should get the
latest version of Mac OS X and the JDK from the Apple website.
To verify you have the right version, run this command from your shell
window. Here’s what I get when I run it:
C:\> java -version
java version "1.6.0_14"
Java(TM)
SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
You should see something similar, with version “1.6.something” or later.
Eclipse
Next, you should install a Java development environment if you don’t
have
one already. I r ecommend Eclipse, because it’s free and because
it’s used and supported by the Google developers who created Android.
The minimum version of Eclipse is 3.3.1, but you should always use
whatever is the most up-to-date production version. Go to the Eclipse
downloads page,
2
and pick “Eclipse IDE for Java Developers.” Note that
y
ou need more than just the standard Eclipse SDK “classic” platform.
Download the package into a temporary directory, unpack it (usually
this is just a matter of double-clicking it), and move the entire unpacked
directory to a permanent location (like C:\Eclipse on Windows or /Appli-
cations/Eclipse on
Mac OS X).
If you don’t want to use Eclipse (there’s always one in every crowd),
support for other IDEs such as NetBeans and JetBrains IDEA is avail-
able from their respective communities. Or if you’re really old-school,
you can forgo an IDE entirely and just use the command-line tools.
3
The rest of the book will assume you’re using Eclipse, so if you’re not,
you’ll need to make adjustments as necessary.
Android SDK Starter Package
Starting with Android 2.0, the Android SDK has been broken into two
parts:
the SDK Starter Package and the SDK Components. First, use
your web browser to get the starter package. The Android download
1. http
://java.sun.com/javase/downloads
2. http://www.eclipse.org/downloads
3. S
ee http
://d.android.com/guide/developing/tools for documentation on the command-line
tools.
Report erratum
t
his copy is (P1.0 printing, July 2010)
From Library of Wow! eBook
IN
STALLING THE TOOLS
19
32-bit vs. 64-bit
If
you’re using a 64-bit version of Windows, you may be tempted
to install the 64-bit version of the Java Development Kit instead
of the 32-bit version. Unfortunately, Eclipse 3.5 does not provide
a 64-bit version of the Eclipse IDE for Java Developers package
(see bug 293969).
∗
There is a workaround (unzip the main pack-
age
fir
st and then unzip the 64-bit “classic” platform on top of
that), but unless you really need 64-bit Java, it’s easier to just
use the 32-bit version of the JDK for now. A 64-bit package will
be available in the next release of Eclipse (version 3.6, “Helios”),
so this whole problem will go away soon.
∗. http
s://bugs.eclipse.org/bugs/show_bug.cgi?id=293969
page
4
has packages for Windows, Mac OS X, and Linux. After down-
loading the package that’s right for you, unpack the .
zip file to a tempo-
rary directory.
By default, the SDK will be expanded into a subdirectory like android-
s
dk-windows. Move that subdirectory underneath a permanent directory
such as C:\Google or /Applications/Google. Then make a note of the full
path
so you can refer to it later as your SDK install directory.
No special install program is needed for either Eclipse or the SDK, but
I do recommend you add the SDK’s tools directory to your PATH.
Android SDK Components
Next, invoke the SDK Setup program. On Windows, run SDK Setup.exe.
On Linux and Mac OS X, run the
tools/android pr ogram, select Available
Packages, put a check mark next to every package, and click Install
Selected.
The Setup program will now display a list of available components
including documentation, platforms, add-on libraries, and USB drivers
(see Figure
1.1, on the following page). Select Accept All and then click
Install.
All the components listed will be downloaded and installed into
your SDK install directory. Note: this can take a long time to complete.
4. http
://d.android.com/sdk
Report erratum
t
his copy is (P1.0 printing, July 2010)
From Library of Wow! eBook
IN
STALLING THE TOOLS
20
Figure 1.1: Installing the Android SDK Components
To make it go faster, you can accept or reject the individual components
separately
instead of installing them all.
If you get an HTTPS SSL error, then cancel the window and select Set-
tings from the main SDK and AVD Manager window. Select the option
Force https:// sources to be fetched using http://, and then click Save
& Apply. Exit the Setup program and start it again.
The next step is to start Eclipse and configure it.
Eclipse Plug-In
To make development easier, Google has written a plug-in for Eclip
se
called
the Android Development Toolkit (ADT). To install the plug-in,
follow these steps (note these directions are for Eclipse 3.5—different
versions may have slightly different menus and options):
1. Start Eclipse by running eclipse.exe on Windows or eclipse on Mac
OS X or Linux. If you’re prompted for a workspace directory, just
accept the default and click OK.
2. Select the Help menu and then select Install New Software... (Help
> Install New Software...). See the Joe Asks. . . on page 22 if you
g
et
a connection error.
Report erratum
t
his copy is (P1.0 printing, July 2010)
From Library of Wow! eBook
剩余301页未读,继续阅读
ppt060984
- 粉丝: 17
- 资源: 32
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C++标准程序库:权威指南
- Java解惑:奇数判断误区与改进方法
- C++编程必读:20种设计模式详解与实战
- LM3S8962微控制器数据手册
- 51单片机C语言实战教程:从入门到精通
- Spring3.0权威指南:JavaEE6实战
- Win32多线程程序设计详解
- Lucene2.9.1开发全攻略:从环境配置到索引创建
- 内存虚拟硬盘技术:提升电脑速度的秘密武器
- Java操作数据库:保存与显示图片到数据库及页面
- ISO14001:2004环境管理体系要求详解
- ShopExV4.8二次开发详解
- 企业形象与产品推广一站式网站建设技术方案揭秘
- Shopex二次开发:触发器与控制器重定向技术详解
- FPGA开发实战指南:创新设计与进阶技巧
- ShopExV4.8二次开发入门:解决升级问题与功能扩展
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功