Android code , Android Phone, Android Developers

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

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.

Configuring the Android Plugin for Eclipse

Posted by admin April - 28 - 2010 - Wednesday ADD COMMENTS


After installing the Android plugin for Eclipse, Eclipse should have prompted you to restart the application. If it did not prompt you, restart Eclipse now. Restarting Eclipse will ensure that the program has a chance to reinitialize with the plugin installed. It is
important to make sure configuration steps like this are followed in order to reduce the chance of misconfigurations.
The Android plugin for Eclipse is configured from the Preferences window of Eclipse.

Proceed as follows:
1. From the main Eclipse window, choose Window | Preferences.
2. In the Preferences window, shown next, select Android in the menu on the left. On the right side of the window, click Browse, find the location of the Android SDK on your hard drive, and enter it in the SDK Location field. Eclipse needs this information to be able to access all the tools that are supplied with Android, such as the emulator.


3. Check the Automatically Sync Projects to Current SDK check box and then
click Apply.

NOTE
The Android plugin for Windows is shipped in a zip file that contains a directory with a very long directory name: android-sdk_m5-rc14-win32. It may help you in future chapters, especially when command-line programming, to rename this directory to something more manageable. You may also want to extract the SDK to the Program Files directory.
4. The final step in setting up the Android SDK is to put it into your PATH statement. If you are using a Microsoft Windows machine, right-click Computer (or My Computer, depending on your version of Windows) and select Properties to open the System Properties dialog box. Click the Advanced tab.
5. Click Environment Variables to display the window of the same name, shown in the following illustration. This is where you can edit your PATH statement.

6. Under System Variables, find the variable PATH and double-click it.
7. In the Edit System Variable dialog box, shown next, add the location of your Android SDK—separated from the existing paths by a semicolon—and click OK to apply your changes, and click OK again in the Environment Variables window.

The Android SDK, Eclipse, and the Android plugin for Eclipse are now fully configured and ready for development. In the next chapter, you will explore the Android SDK, and learn about its features. The Android SDK contains many tools to help you develop full-featured cell phone applications.

Downloading and Installing the Android Plugin for Eclipse

Posted by admin April - 17 - 2010 - Saturday ADD COMMENTS

The first step in setting up the Android SDK within the Eclipse development environment is to download and install the Android plugin for Eclipse. Both tasks of downloading and installing the plugin can be performed at the same time, and are relatively easy to do:

1. Open the Eclipse application. You will download the Android plugin for Eclipse from within the Eclipse IDE.

2. Choose Help | Software Updates | Find and Install.


3. In the Install/Update window, which allows you to begin the process of downloading and installing any of the plugins that are available to you for Eclipse, click the Search for New Features to Install radio button and then click  Next.


4. The Update Sites to Visit page of the Install window, shown next, lists all the default websites used for obtaining Eclipse plugins. However, the plugin you want, Android for Eclipse, is not available from the default sites. To download the Android plugin, you must tell Eclipse where to look for it, so click the New Remote Site button.

5. In the New Update Site dialog box, shown next, you must enter two pieces of 5.information to continue: a name for your new site, and its associated URL. The name is only for display purposes and does not affect the downloading of the plugin. In the Name field, enter Android Plugin. In the URL field, enter the URL from which Eclipse will obtain information about the plugins that are available:
https://dl-ssl.google.com/android/eclipse/ . Click OK.


NOTE
The name for your site can be anything you want, as long as it will help you identify what the link is. Feel free to use something other than Android Plugin.

6.A new site named Android Plugin should now be in your list of available sites:

At this point Eclipse has not yet looked for the plugin; this is just a list of paths that you can tell Eclipse to check when looking for new plugins to install.

7. Check the check box next to Android Plugin and then click Finish. Eclipse searches the URL associated with the Android Plugin site for any available plugins.

8. On the Search Results page of the Updates window, select the Android Plugin and then click Finish.

9. On the Feature License page of the Install window, shown next, accept the licensing agreement for the Android Development Tools and click Next.


NOTE
Keep in mind that all Eclipse plugins are installed to the %installpath%/eclipse/plugins directory. This information will help you if you need to locate the files that make up the Android plugin.
10. Eclipse downloads the Android plugin. At the time of this writing, the plugin version is 10. 0.4.0.200802081635. On the final plugin installation page, Feature Verification, click Install All to complete the installation of the Android plugin.

With the Android plugin installed, the last step you have to perform is to configure the plugin.

Downloading and Installing the Android SDK

Posted by admin April - 13 - 2010 - Tuesday ADD COMMENTS

To begin, you are going to download the Android SDK from the Google Android development site, located at http://code.google.com/android. The Google Android Development home page contains a host of valuable tools and documents about developing for the Android platform, including links to the Android developer forum (or “community”).

TIP
If you ever encounter a problem while you are developing an Android application, the first place you should look for an answer is the Android developers’ forum at http://code.google.com/android/groups.html. There are discussion groups for beginners, developers, and “hackers,” and a general-issue discussion group. Given that Android is such a new platform, the Android developers’ forum is one of the few places to find comprehensive, reliable information about developing for the product.

Downloading the Android SDK
The Android SDK is easily accessible from the http://code.google.com/android page. From the development home page, click the Download the SDK link under Getting Started. After you agree to the terms of the Android SDK License Agreement, you will see the Download the Android SDK page. The Android SDK is downloaded in a 79MB (for Windows) package and it should download fairly quickly. Click the package name
for your operating system to begin the download.

NOTE
Download sizes for other operating systems may vary. There is no “setup” or installation process to speak of for the Android SDK; rather,
you must follow a series of steps to associate the SDK with your Eclipse development environment. The first of these steps is to obtain the Android plugin for Eclipse, after which you will configure it.

After Eclipse installation

Posted by admin April - 6 - 2010 - Tuesday ADD COMMENTS

After you have downloaded Eclipse, it is time to install it. Navigate to the location where you downloaded the Eclipse package. As of the writing of this book, the latest Eclipse package file for Microsoft Windows is eclipse-java-europa-fall2-win32.zip.
Expand the package and run the eclipse.exe file. Eclipse installs to your User directory by default (under Microsoft Windows), but you may want to install it to your Program Files directory. This will keep your applications in order and still allow you to set a different location for your workspaces. The following illustration shows the Eclipse title screen that appears upon startup.

EclipseIf you do not see the splash screen shown in the illustration, try rebooting your machine.If rebooting does not help, download and install the Java 5 JRE only.Once the Eclipse installation commences, you will be prompted to create a default workspace, or folder. Just as in most development environments, projects are created in, and saved to, a workspace. The default path for the workspace is your User directory,as shown in the illustration that follows. To select a different location, click Browse and navigate to it.

I recommend that you also check the check box that defaults all of your projects to the specified workspace. By checking this box, you will have one less thing to worry about when creating new projects and you will always know in what directory structure to find your source files. In this book, sometimes you will be navigating to the project files to work on them outside of the Android development environment, so knowing exactly where they are will be helpful.

After you select a location for your workspace, click OK.

At this point, your development environment is downloaded and installed. While the installation of Eclipse seemed deceivingly quick, you still need to do some configuration work before you can create your first Android project. Much of the configuration work that you need to do centers on the Android SDK and the Android plugin for Eclipse. Next you need to download and install the Android SDK, download and install the
Android plugin for Eclipse, and configure the Eclipse settings.

Eclipse the recommended IDE for Android applications

Posted by admin March - 9 - 2010 - Tuesday ADD COMMENTS

Why is Eclipse the recommended IDE for Android applications? There are a few reasons for this particular endorsement:

● In keeping with the Open Handset Alliance’s theme of truly opening the mobile development market, Eclipse is one of the most fully featured, free, Java IDEs available. Eclipse is also very easy to use, with a minimal learning curve. This makes Eclipse a very attractive IDE for solid, open Java development.

● The Open Handset Alliance has released an Android plugin for Eclipse that allows you to create Android-specific projects, compile them, and use the Android Emulator to run and debug them. These tools and abilities will prove invaluable when you are creating your first Android apps. You can still create Android apps in other IDEs, but the Android plugin for Eclipse creates certain setup elements—such as files and compiler settings—for you. The help provided by the Android plugin for Eclipse saves you precious development time and greatly reduces the learning curve, which means you can spend more time creating incredible applications.

NOTE
Eclipse is also available for Mac and Linux. Having greater availability, on numerous operating systems, means that almost anyone can develop Android applications on
any computer. However, the examples and screenshots in this book are given from the Microsoft Windows version of Eclipse. Keep this in mind if you are using Eclipse
in a non-Microsoft environment; your interface may look slightly different from the screenshots, but the overall functionality should not change. If there is a major change
in operation of Eclipse under Linux, I will include an example of that change. I will provide several examples from within a Linux environment. The majority of these
examples will be from the Linux/Android command-line environment.

Android applications are developed in Java

Posted by admin March - 9 - 2010 - Tuesday ADD COMMENTS

Android applications are developed in Java. Android itself is not a language, but rather an environment within which to run applications. As such, you can theoretically use any distribution or integrated development environment (IDE) you have at your disposal to begin your development. In fact, you can choose to use no IDE at all. If you are more comfortable with one Java IDE over any other, such as JBuilder by Borland or the open source NetBeans, feel free to use it. With a moderate level of experience, you should still be able to follow along with the majority of the examples in this book. However, the Open Handset Alliance and Google do endorse one Java IDE over any others: Eclipse.