Thứ Tư, 19 tháng 12, 2012
android book 20121220
INTRODUCTION
THIS IS AN EXCITING TIME FOR ANDROID DEVELOPERS. Mobile phones have never been more popu-
lar; powerful smartphones are now a regular choice for consumers; and the Android ecosystem
has expanded to include tablet and TV devices to further expand the audience of your Android
applications.
Hundreds of stylish and versatile devices — packing hardware features such as GPS, accelerometers,
NFC, and touch screens, combined with reasonably priced data plans — provide an enticing plat-
form upon which to create innovative applications for all Android devices.
Android offers an open alternative for mobile application development. Without artifi cial barriers,
Android developers are free to write applications that take full advantage of increasingly powerful
mobile hardware and distribute them in an open market. As a result, developer interest in Android
devices has exploded as handset sales have continued to grow. As of 2012, there are hundreds of
handset and tablet OEMs, including HTC, Motorola, LG, Samsung, ASUS, and Sony Ericsson.
More than 300 million Android devices have been activated, and that number is growing at a rate of
over 850,000 activations every day.
Using Google Play for distribution, developers can take advantage of an open marketplace, with no
review process, for distributing free and paid applications to all compatible Android devices. Built
on an open-source framework, and featuring powerful SDK libraries, Android has enabled more
than 450,000 applications to be launched in Google Play.
This book is a hands-on guide to building mobile applications using version 4 of the Android SDK.
Chapter by chapter, it takes you through a series of sample projects, each introducing new features
and techniques to get the most out of Android. It covers all the basic functionality to get started, as
well as the information for experienced mobile developers to leverage the unique features of Android
to enhance existing products or create innovative new ones.
Google’s philosophy is to release early and iterate often. Since Android’s fi rst full release in
December 2008, there have been 19 platform and SDK releases. With such a rapid release cycle,
there are likely to be regular changes and improvements to the software and development libraries.
While the Android engineering team works hard to ensure backward compatibility, future releases
are likely to date some of the information provided in this book. Similarly, not all active Android
devices will be running the latest platform release.
Wherever possible, I have included details on which platform releases support the functionality
described, and which alternatives may exist to provide support for users of older devices. Further,
the explanations and examples included will give you the grounding and knowledge needed to write
compelling mobile applications using the current SDK, along with the fl exibility to quickly adapt to
future enhancements.
WHO THIS BOOK IS FOR
This book is for anyone interested in creating applications for the Android platform. It includes
information that will be valuable, whether you’re an experienced mobile developer or making your
fi rst foray, via Android, into writing mobile applications.
It will help if you have used smartphones (particularly phones running Android), but it’s not neces-
sary, nor is prior experience in mobile application development.
It’s expected that you’ll have some experience in software development and be familiar with basic
object-oriented development practices. An understanding of Java syntax is a requirement, and
detailed knowledge and experience is a distinct advantage, though not a strict necessity.
Chapters 1 and 2 introduce mobile development and contain instructions to get you started in
Android. Beyond that, there’s no requirement to read the chapters in order, although a good under-
standing of the core components described in Chapters 3–9 is important before you venture into
the remaining chapters. Chapters 10 and 11 cover important details on how to create an application
that provides a rich and consistent user experience, while Chapters 12–19 cover a variety of optional
and advanced functionality and can be read in whatever order interest or need dictates.
WHAT THIS BOOK COVERS
Chapter 1 introduces Android, including what it is and how it fi ts into existing mobile development.
What Android offers as a development platform and why it’s an exciting opportunity for creating
mobile phone applications are then examined in greater detail.
Chapter 2 covers some best practices for mobile development and explains how to download the
Android SDK and start developing applications. It also introduces the Android Developer Tools and
demonstrates how to create new applications from scratch.
Chapters 3–9 take an in-depth look at the fundamental Android application components. Starting
with examining the pieces that make up an Android application and its lifecycle, you’ll quickly move
on to the application manifest and external resources before learning about “Activities,” their life-
times, and their lifecycles.
You’ll then learn how to create basic user interfaces with layouts, Views, and Fragments, before being
introduced to the Intent and Broadcast Receiver mechanisms used to perform actions and send mes-
sages between application components. Internet resources are then covered, followed by a detailed
look at data storage, retrieval, and sharing. You’ll start with the preference-saving mechanism and
then move on to fi le handling, databases, and Cursors. You’ll also learn how share application data
using Content Providers and access data from the native Content Providers. This section fi nishes with
an examination of how to work in the background using Services and background Threads.
Chapters 10 and 11 build on the UI lessons you learned in Chapter 4, examining how to enhance
the user experience through the use of the Action Bar, Menu System, and Notifi cations. You’ll
learn how to make your applications display-agnostic (optimized for a variety of screen sizes and
resolutions), how to make your applications accessible, and how to use speech recognition within
your applications.
Chapters 12–18 look at more advanced topics. You’ll learn how to use the compass, accelerometers,
and other hardware sensors to let your application react to its environment, and then look at maps
and location-based services. Next, you’ll learn how your applications can interact with users directly
from the home screen using dynamic Widgets, Live Wallpaper, and the Quick Search Box.
After looking at playing and recording multimedia, and using the camera, you’ll be introduced to
Android’s communication capabilities. Bluetooth, NFC, Wi-Fi Direct, and network management
(both Wi-Fi and mobile data connections) are covered, followed by the telephony APIs and the APIs
used to send and receive SMS messages.
Chapter 18 discusses several advanced development topics, including security, IPC, Cloud to Device
Messaging, the License Verifi cation Library, and Strict Mode.
Finally, Chapter 19 examines the options and opportunities available for publishing, distributing,
and monetizing your applications — primarily within Google Play.
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.
Experienced mobile developers with a working Android development environment can skim the fi rst
two chapters — which are an introduction to mobile development and instructions for creating your
development environment — and then dive in at Chapters 3–9. These chapters cover the fundamentals
of Android development, so it’s important to have a solid understanding of the concepts they describe.
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.
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
want to download and install Eclipse and the Android Developer Tools plug-in to ease your develop-
ment, but neither is a requirement.
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, though it can
be useful — particularly when testing.
Đăng ký:
Đăng Nhận xét (Atom)
It is good blog for beginners.
Trả lờiXóaandroid apps development