This chapter introduces the Android operating system, giving you a little background information to put things into perspective. We'll visit just how expansive this platform has become in today's Internet 2.0 environment of portable consumer electronic devices. Internet 2.0 here refers to the consumption of the Internet over a wide variety of different types of data networks using highly portable consumer electronic devices, including smartphones, tablets, e-book readers, and even new emerging consumer electronic products such as interactive television (iTV).
As this is an introductory book on the subject, not all of the advanced new media-related areas, such as 3D and video streaming, will be covered. Some specifics of what the book will and will not cover are outlined in this chapter.
At the end of the chapter, you'll learn which tools you need to obtain in order to develop for the Google Android platform, with instructions on how to download them.
Those of you who already recognize the significance of the Android revolution and know which tools are needed to develop Android applications development may want to skip this chapter. However, may be some tidbits in here that could spawn development ideas —so skip along at your own risk!
Just a bit of fair warning: developing reliable applications for Android is not in any way a trivial task. It takes a fair amount of knowledge of both high-level programming languages such as Java and markup languages like XML. Building useful and engaging new media applications also requires a deep knowledge of related new media technologies such as 2D imaging, 3D rendering, audio processing, video streaming, GPS localization, and database design.
Don't expect to learn all of this at one sitting. Becoming a top-notch Android programmer will take years of dedication and practice, as well as diligent research and trial and error. In this book, you will gain the foundation that you need to build future expertise, as well as learn the work process for eventually building your Android masterpeice.
Android was originally created by Andy Rubin as an operating system for mobile phones, around the dawn of this twenty-first century. In 2005, Google acquired Android Inc., and made Andy Rubin the Director of Mobile Platforms for Google. Many think the acquisition was largely in response to the emergence of the Apple iPhone around that time; however, there were enough other large players, such as Nokia Symbian and Microsoft Windows Mobile, that it seemed like a salient business decision for Google to purchase the talent and intellectual property necessary to assert the company into this emerging space, which has become known as Internet 2.0.
Internet 2.0 allows users of consumer electronics to access content via widely varied data networks through highly portable consumer electronic devices, such as smartphones, touchscreen tablets, and e-books, and even through not so portable devices, such as iTVs, home media centers, and set-top boxes. This puts new media content such as games, 3D animation, digital video, digital audio, and high-definition imagery into our lives at every turn. Android is one of the vehicles that digital artists will leverage to develop media creations that users have never before experienced.
Over the past decade, Android has matured and evolved into an extremely reliable, bulletproof, embedded operating system platform, having gone from version 1.0 to stable versions at 1.5, 1.6, 2.0, 2.1, 2.2, 2.3, and, recently, 3.0. An embedded operating system is like having an entire computer on a chip small enough to fit into handheld consumer electronics, but powerful enough to run applications (commonly known as apps).
Android has the power of a full-blown computer operating system. It is based on the Linux open source platform and Oracle's (formerly Sun Microsystems's) Java, one of the world's most popular programming languages.
The term open source refers to software that has often been developed collaboratively by an open community of individuals, is freely available for commercial use, and comes with all of the source code so that it can be further modified if necessary. Android is open source, though Google develops it internally before releasing the source code; from that point on, it is freely available for commercial use.
It is not uncommon for an Android product to have a 1GHz processor and 1GB of fast, computer-grade DDR2 memory. This rivals desktop computers of just a few years ago and netbooks that are still currently available. You will see a further convergence of handheld operating systems and desktop operating systems as time goes on. Some examples are the Windows Mobile 7 and iPhone 4 mobile platforms.
Once it became evident that Android and open source were forces to be reckoned with, a number of major companies—including HTC, Samsung, LG Electronics, and T-Mobile—formed and joined the Open Handset Alliance (OHA). This was done in order to put some momentum behind Google's open source Android platform, and it worked.
Today, more brand manufacturers use Android as an operating system on their consumer electronic devices than any other operating system.
This development of the OHA is a major benefit to Android developers. Android allows developers to create their applications in a single environment, and support by the OHA lets developers deliver their content across dozens of major branded manufacturer's products, as well as across several different types of consumer electronic devices: smartphones, iTV sets, e-book readers, home media centers, set-top boxes, and touchscreen tablets. Exciting possibilities—to say the least.
So, Android is a seasoned operating system that has become one of the biggest players in computing today, and with Google behind it. Android uses freely available open source technologies such as Linux and Java, and standards such as XML, to provide a content and application delivery platform to developers as well as the world's largest consumer electronics manufacturers. Can you spell O-P-P-O-R-T-U-N-I-T-Y? I sure can ... it's spelled ANDROID.
There are simply too many benefits of the Android platform to ignore Android development.
First of all, Android is based on open source technology, which was at its inception not as refined as paid technologies from Apple and Microsoft. However, over the past two decades, open source software technology has become equally as sophisticated as conventional development technologies. This is evident in Internet 2.0, as the majority of the consumer electronics manufacturers have chosen Linux and Java over the Windows and Macintosh operating systems. Therefore, Android developers can develop not only for smartphones, but also for new and emerging consumer electronic devices that are network-compatible and thus available to connect to the Android Market. This translates into more sales onto more devices in more areas of the customer's life, and thus more incentive to develop for Android over closed and PC operating systems.
In addition to being free for commercial use, Android has one of the largest, wealthiest, and most innovative companies in modern-day computing behind it: Google. Add in the OHA, and you have more than a trillion dollars of megabrand companies behind you supporting your development efforts. It seems too good to be true, but it's a fact, if you are an Android developer (which you are about to be, in about a dozen chapters).
Finally, and most important, it's much easier to get your Android applications published than those for other platforms that are similar to Android (I won't mention any names here to protect the not so innocent). We've all heard the horror stories regarding major development companies waiting months, and sometimes years, for their apps to be approved for the app marketplace. These problems are nearly nonexistent on the open source Android platform. Publishing your app on Android Market is as easy as paying $25, uploading your .apk file, and specifying free or paid download.
This book is an introduction to developing applications on Android. It's intended for absolute beginners—that is, people who have never created an application on the Android platform for a consumer electronic device. I do not assume that you know what Java is or how XML works.
This book covers the basic and essential elements of Android development, including the following:
The open source tools required to develop for this platform
Where to get these free tools
How to properly install and configure the necessary tools for applications development
Which third-party tools are useful to use in conjunction with the Android development tools
Which operating systems and platforms currently support development for the Android using these tools
The concepts and programming constructs for Java and XML, and their practical applications in creating Android applications
How Android goes about setting up an Android application
How it defines the user interfaces
How it writes to the display screen
How it communicates with other Android applications
How it interfaces with data, resources, networks, and the Internet
How it alerts users to events that are taking place inside and outside the application
How Android applications are published
How Android applications are ultimately sold, downloaded, and updated automatically through the Android Market
Realize that Android has more than 44 Java packages that contain over 7,000 pieces of programming code functionality to allow you to do just about anything imaginable—from putting a button on the screen to synthesizing speech and accessing advanced smartphone features like the high-resolution camera, GPS, and accelerometer.
A package in Java is a collection of programming utilities that all have related and interconnected functionality. For example, the java.io
package contains utilities to deal with input and output to your program, such as reading the contents of a file or saving data to a file. Later chapters describe how to organize your own code into packages.
What does this mean? It means that even the most advanced Android books cannot cover the plethora of things that the Android platform can do. In fact, most books specialize in a specific area in the Android APIs. There is plenty of complexity in each API, which ultimately, from the developer's viewpoint, translates into incredible creative power.
So, what isn't covered in this book? What cool, powerful capabilities do you have to look forward to in that next level book on Android programming?
On the hardware side, we will not be looking at how to control the camera, access GPS data from the smartphone, and access the accelerometer and gyroscope that allow the user to turn the phone around and have the application react to phone positioning. We will not be delving into advanced touchscreen concepts such as gestures, or accessing other hardware such as the microphone, Bluetooth, and wireless connections.
On the software side, we will not be diving into creating your own Android MySqLite Database Structure, or its new media codecs for digital video and digital audio, and its real-time 3D rendering system (called OpenGL ES). We will not be exploring speech synthesis and recognition, or the universal language support that allows developers to create applications that display characters correctly in dozens of international languages and foreign character sets. We will not be getting into advanced programming such as game development, artificial intelligence, and physics simulations. All of these topics are better suited to books that focus on these complex and detailed topical areas.
In Chapter 3, you'll learn how to set up a complete Android development environment. We'llfocus on Windows, because that's what I use to develop for Android, but the process on Mac or Linux systems is similar, and I'll make sure you can follow along if you prefer either of those systems.
Here, we'll look at where to go to download the tools you'll need, so that you are ready for action when the time comes to install and configure them. This is because each of these development tools is hundreds of megabytes in file size, and depending on your connection speed, may take anywhere from ten minutes to ten hours to download.
There are three major components of an Android development environment:
Java
Eclipse
Android
In Chapter 3, when you install and configure the packages you are downloading now, you will see that Eclipse requires the Java package to be installed in order to install and run. Therefore, we will walk through downloading them in the order of installation, from Java to Eclipse to Android.
Let's start with the foundation for everything we are doing, the Java Platform, Standard Edition (Java SE). Java SE contains the core Java programming language.
To download Java SE, simply go to the Java SE Downloads section of Oracle's web site, which is in the Technology Network section under the Java directory, at this URL:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Figure 1-1 shows the Java SE Downloads site.
Click the Download JDK button to start downloading the Java SE Java Development Kit (JDK). Then choose your platform from the drop-down menu that appears, accept the license, and click the Continue button. You will be shown a link to the download that you selected. Click that link to start the download.
Make sure not to download Java Platform, Enterprise Edition (Java EE), JavaFX, or Java with NetBeans.
Eclipse is an integrated development environment (IDE), which is a piece of software dedicated to allowing you to more easily write programming code, and run and test that code in an integrated environment. In other words, you write all your code into its text editor, before running and testing that code using commands in Eclipse, without ever needing to switch to another program.
Currently, Android requires the Galileo version of Eclipse (not Helios). You should download the version of Eclipse that supports Java—Eclipse IDE for Java Developers. Go to the Eclipse web site's Downloads section at this URL:
http://www.eclipse.org/downloads/packages/release/galileo/sr2
Figure 1-2 shows the Galileo package you want to download.
Click the link in the right-hand column that matches your system, and then choose the site from which to download.
The Android Software Development Kit (SDK) is a collection of files and utilities that work hand in hand with the Eclipse IDE to create an Android-specific development tool.
To dowload the Android SDK, go to the Android Developers web site, located at this URL:
http://developer.android.com/sdk/index.html
Figure 1-3 shows the Android SDK packages available. Download the latest SDK for the platform you are using.
We will walk through installing the other minor packages (shown on the left side of Figure 1-3) using Eclipse in Chapter 3. For now, you don't need to worry about anything except downloading the main SDK.
Once the Eclipse and Android SDKs are installed and configured, you can further enhance them by installing phone emulators and other add-ins, which are covered in Chapter 3. In that chapter, we will go through the detailed setup of the Eclipse IDE for Android development.
Andy Rubin's creation called Android was purchased by Google in 2005 and made freely available to developers to create mobile device applications using Java and XML. Since then, the Android phenomenon has grown to encompass an open industry alliance of the leading manufacturers and become the fastest growing mobile platform today. It is the horse to bet on for the future of not only mobile devices, but also other types of consumer electronic devices, including tablets and iTV.
What you will learn about in this book spans from how and where to get the Android development environment to how to set it up properly, how to configure it optimally, and how to use it to create applications that employ the powerful features of Android.
The three basic components you'll need for Android development are Java, Eclipse, and of course, Android. You can download these various components for free, as described in this chapter. Once the Android SDK is installed in Eclipse, that IDE becomes a comprehensive Android application development environment.
The next chapter provides an overview of what you will learn in this book, and then we'll get started with setup in Chapter 3.
35.171.45.182