Android code , Android Phone, Android Developers

Android code , Android Phone, Android Developers and New Google Android Technologies

Archive for May, 2010

Run the API Demos Sample Application

Posted by admin May - 31 - 2010 - Monday ADD COMMENTS

Using Eclipse, load the API Demos application as a New Android Project. To do this, select File | New | Project from the Eclipse menu bar; a New Android Project wizard opens. Do not worry about the options in this wizard for now. Simply select Create Project From Existing Source and browse to the folder with the API Demo application in it. When the project is loaded, choose Run to see it execute in the Android Emulator. Navigate your way through the more than 40 different applications. Use each application to become familiar with the terminology and function of each API tool it demonstrates.

The Hello, Activity! application, shown in the following illustration, is a simple Hello World!–style application. Though simple in its design, Hello, Activity! does a good job of showing off the abilities of the platform. You will create your own Hello World!–style applications soon.

Lunar Lander
Lunar Lander, shown next, is a small game that plays on the Android Emulator. Lunar Lander shows how a simple 2-D game works on Android. The controls are fairly simple, and the game is not very complex. However, given these drawbacks, it is a great starter for game development.

Lunar Lander implements a simple control scheme (Up, Down, Left, and Right). The game also displays relatively fluid graphics and looks impressive given the platform. Complex game theories such as collision detection are used in a simple way. Although this book does not cover programming games for the Android platform, if you are interested in doing so, you may want to look at Lunar Lander for some tips.

Note Pad
Note Pad, as shown in the illustration that follows, allows you to open, create, and edit small notes. Note Pad is not a full-featured word editor, so do not expect it to be something to rival Word for Windows Mobile. However, it does a good job as a demonstration tool to show what is possible with a relatively small amount of code.

Skeleton App
Skeleton App, shown next, is an application shell. This is more of a base application that demonstrates a couple of different application features, such as fonts, buttons, images, and forms. If you are going to run Skeleton App by itself, you really are not going to get much out of it. You will be better served by referring to Skeleton App as a resource for how to implement specific items.

Snake
The final demo that is included with the Android SDK is Snake. This is a small, SNAFU-style game that is far more simplistic than Lunar Lander. This illustration shows what Snake looks like when run.

If you navigate to the base folder of each of the sample applications, you will see a folder named src. This is the source code folder for the given sample application. You can use this to view, edit, and recompile the code for any of the applications. Take advantage of this source code to learn some tricks and tips about the Android platform.

Android Samples

Posted by admin May - 24 - 2010 - Monday ADD COMMENTS

The Samples folder, ../%sdk folder%/SAMPLES, contains six sample applications that demonstrate a good cross-section of Android functionality:

● API Demos
● Hello, Activity!
● Lunar Lander

● Note Pad
● Skeleton App
● Snake

These sample applications are provided by Google to give you a quick idea of how to develop an Android application. Each sample application demonstrates a different piece of Android’s functionality. You can open and run these applications from within Eclipse. Following is a brief description of each.

API Demos

The API Demos application is a host application that demonstrates multiple API functions
in a single Activity.

TIP
An Activity is an Android application. Activities are covered in more depth in the following chapters.
The API Demos application, as shown in the following illustration, contains multiple, smaller, examples of different Android functions:
Some of the applications included in the API Demos sample include 3-D image transitions, list and progress dialog boxes, and a finger-painting demo.

Android Documentation

Posted by admin May - 19 - 2010 - Wednesday ADD COMMENTS

The Android documentation is located in the Docs folder within the Android SDK at ../%sdk folder%/DOCS. The documentation that is supplied with the SDK includes steps on downloading and installing the SDK, “Getting Started” quick steps for developing applications, and package definitions. The documentation is in HTML format and can be accessed though the documentation.html file in the root of the SDK folder. The following illustration depicts the main page of the Android SDK documentation.  You can navigate to all of the documentation that is included in the Android SDK by using the links within documentation.html.

CAUTION
As you are navigating the Android SDK, you may think some pages are mislinked or missing, because the right side of the screen may be blank when you click some links. However, if you scroll down you will see that the pages are just misaligned. In working with the Android SDK, we have found that there are sections of the documentation that we refer to more than others. For me, the most valuable segments of the Android SDK documentation are as follows (as they appear in the navigation bar):
● Reference Information
● Class Index
● List of Permissions
● List of Resource Types
● FAQs
● Troubleshooting

The Troubleshooting subsection of the documentation will be especially helpful as you are starting out. As you progress through the book and begin to develop your own Android applications, you will find that the Reference Information section of the documentation is more helpful. For example, while it would have little to no use to you now, the List of Permissions subsection will be very helpful to you when you progress to
the section of the book that deals with creating more complex applications. Take some time to familiarize yourself with the Android SDK documentation and the hundreds of documents that have been provided for you.

What Is in the Android SDK?

Posted by admin May - 10 - 2010 - Monday ADD COMMENTS

The Android SDK is downloaded in a simple zipped package The bulk of the Android SDK, in number of files, consists of documentation, with programming APIs, tools, and samples comprising the rest. This section provides a closer look at exactly what is included in the Android SDK.
extract the Android SDK to the Program Files folder, so that it would be easier to track. If you are having trouble finding the SDK because you used the default extraction setting, it should be in the following folder: /%downloadfolder%/android-sdk_m5-rc14_windows/android-sdk_m5-rc14_windows.

Navigate to the folder where you unpacked the Android SDK so that you can begin to explore the folder structure within. While there are a few files in the root folder, like android.jar (a compiled Java application containing the core SDK libraries and APIs) and some release notes, the remainder of the Android SDK is divided into three main folders:  Docs Contains all of the accompanying Android documentation

NOTE
Much of the documentation found in the Docs folder can also be found on the http://code.google.com/android Android development site.
● Samples Contains six sample applications that you can compile and test from within Eclipse
● Tools Contains all of the development, compilation, and debugging tools that you need throughout the development process of an Android application

The following sections discuss in a bit more detail what is included in each of the SDK folders. Each API demo is compiled and run to illustrate the capabilities of Android. Many of the tools are discussed and demonstrated in later chapters as you learn how to create and compile applications using the command-line options of Microsoft Windows and Linux.

T-Mobile G1 Android Phone Hands-On

Posted by admin May - 4 - 2010 - Tuesday ADD COMMENTS
YouTube Preview Image