Showing posts with label Android Tutorials. Show all posts
Showing posts with label Android Tutorials. Show all posts

Thursday, June 10, 2010

Android Platform Architecture

What is Android?

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

Features

* Application framework enabling reuse and replacement of components
* Dalvik virtual machine optimized for mobile devices
* Integrated browser based on the open source WebKit engine
* Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
* SQLite for structured data storage
* Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
* GSM Telephony (hardware dependent)
* Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
* Camera, GPS, compass, and accelerometer (hardware dependent)
* Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE

Android Architecture

The following diagram shows the major components of the Android operating system. Each section is described in more detail below.



Applications

Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.

Application Framework

By providing an open development platform, Android offers developers the ability to build extremely rich and innovative applications. Developers are free to take advantage of the device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much, much more.

Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework). This same mechanism allows components to be replaced by the user.

Underlying all applications is a set of services and systems, including:

* A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser
* Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data
* A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files
* A Notification Manager that enables all applications to display custom alerts in the status bar
* An Activity Manager that manages the lifecycle of applications and provides a common navigation backstack

Libraries

Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are listed below:

* System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices
* Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
* Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications
* LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view
* SGL - the underlying 2D graphics engine
* 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer
* FreeType - bitmap and vector font rendering
* SQLite - a powerful and lightweight relational database engine available to all applications

Android Runtime

Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.

Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool.

The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.

Linux Kernel

Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

Reference :: http://developer.android.com/guide/basics/what-is-android.html

Monday, June 7, 2010

Creating an Android Development Environment

The Android Software Development Kit supports Windows (XP and Vista), Linux (tested on Ubuntu Dapper Drake, but any recent Linux distro should work), and Mac OS X (10.4.8 or later, Intel platform only) as host development environments. Installation of the SDK is substantially the same for any of the operating systems, and most of this description applies equally to all of them. Where the procedure differs, we will clearly tell you what to do for each environment:

Install JDK: The Android SDK requires JDK version 5 or version 6. If you already have one of those installed, skip to the next step. In particular, Mac OS X comes with the JDK version 5 already installed, and many Linux distributions include a JDK. If the JDK is not installed, go to and you'll see a list of Java products to download. You want JDK 6 Update n for your operating system, where n is 6 at the time of this writing.



Windows (XP and Vista)

Select the distribution for "Windows Offline Installation, Multi-language."

Read, review, and accept Sun's license for the JDK. (The license has become very permissive, but if you have a problem with it, alternative free JDKs exist.)

Once the download is complete, a dialog box will ask you whether you want to run the downloaded executable. When you select "Run," the Windows Installer will start up and lead you through a dialog to install the JDK on your PC.



Linux

Select the distribution for "Linux self-extracting file."

Read, review, and accept Sun's license for the JDK. (The license has become very permissive, but if you have a problem with it, alternative free JDKs exist.)

You will need to download the self-extracting binary to the location in which you want to install the JDK on your filesystem. If that is a system-wide directory (such as /usr/local), you will need root access. After the file is downloaded, make it executable (chmod +x jdk-6version-linux-i586.bin), and execute it. It will self-extract to create a tree of directories.



Mac OS X

Mac OS X comes with JDK version 5 already loaded.

Install Eclipse: The Android SDK requires Eclipse version 3.3 or later. If you do not have that version of Eclipse installed yet, you will need to go to to get it, and you might as well get version 3.4 (also known as Ganymede), since that package includes the required plug-ins mentioned in the next step. You want the version of the Eclipse IDE labeled "Eclipse IDE for Java Developers," and obviously you want the version for your operating system. Eclipse will ask you to select a mirror site, and will then start the download.



Windows (XP or Vista)

The Eclipse download comes as a big ZIP file that you install by extracting the files to your favorite directory. For this book, we'll assume that you extracted to C:/eclipse. Eclipse is now installed, but it will not show up in your Start menu of applications. You may want to create a Windows shortcut for C:/eclipse/eclipse.exe and place it on your desktop, in your Start menu, or someplace else where you can easily find it.



Linux and Mac OS X

Note that, as of this writing, the version of Eclipse installed if you request it on Ubuntu Hardy Heron is 3.2.2, which does not contain all the plug-ins needed for Android. The Eclipse download comes as a big tarball (.gz file) that you install by extracting the files to your favorite directory. For this book, we'll assume that you extracted to /usr/lib/eclipse. The executable itself is located in that directory and is named eclipse.

Check for required plug-ins: You can skip this step if you just downloaded a current version of Eclipse as we recommended. If you are using a preinstalled version of Eclipse, you need to make sure you have the Java Development Tool (JDT) and Web Standard Tools (WST) plug-ins. You can easily check to see whether they are installed by starting Eclipse and selecting menu options "Windows Preferences...". The list of preferences should include one for "Java" and one for either "XML" or "Web and XML." If they aren't on the list, the easiest thing to do is reinstall Eclipse, as described in the previous step. Installing "Eclipse IDE for Java Developers" will automatically get the needed plug-ins.

Install Android SDK: This is where you should start if you already have the right versions of Eclipse and the JDK loaded. The Android SDK is distributed through Google's Android site, . You will need to read, review, and accept the terms of the license to proceed. When you get to the list of downloads, you will see a table of distributions. Select the one for your operating system (XP and Vista use the same distribution). The package (file) names include the release number. For example, as this is written, the latest version of the SDK is 1.1_r1, so the filename for Windows is android-sdk-win⁠dows-1.1_r1.zip.

For versions 3.3 and later of Eclipse, the Android download site provides directions about how to install the plug-in through Eclipse's software updates utility. If you're using Eclipse 3.2 or the software update technique doesn't work for you, download the SDK from the Android site and install it using instructions in the next paragraph.

The file you download is another archive file, as with Eclipse: a ZIP file on Windows, a tar-zipped file for Linux and MacOS X. Do the same thing as for Eclipse: extract the archive file to a directory where you want to install Android, and make a note of the directory name (you'll need it in step 6). The extraction will create a directory tree containing a bunch of subdirectories, including one called tools.

Update the environment variables: To make it easier to launch the Android tools, add the tools directory to your path.

On Windows XP, click on Start, then right-click on My Computer. In the pop-up menu, click on Properties. In the resulting System Properties dialog box, select the Advanced tab. Near the bottom of the Advanced tab is a button, "Environment Variables," that takes you to an Environment Variables dialog. User environment variables are listed in the top half of the box, and System environment variables in the bottom half. Scroll down the list of System environment variables until you find "Path"; select it, and click the "Edit" button. Now you will be in an Edit System Variable dialog that allows you to change the environment variable "Path." Add the full path of the tools directory to the end of the existing Path variable and click "OK." You should now see the new version of the variable in the displayed list. Click "OK" and then "OK" again to exit the dialog boxes.

On Windows Vista, click on the Microsoft "flag" in the lower left of the desktop, then right-click on Computer. At the top of the resulting display, just below the menu bar, click on "System Properties." In the column on the left of the resulting box, click on "Advanced system settings." Vista will warn you with a dialog box that says "Windows needs your permission to continue"; click "Continue." Near the bottom of the System Properties box is a button labeled "Environment Variables" that takes you to an Environment Variables dialog. User environment variables are listed in the top half of the box, and System environment variables in the bottom half. Scroll down the list of System environment variables until you find "Path"; select it, and click the "Edit" button. Now you will be in an Edit System Variable dialog that allows you to change the environment variable "Path." Add the full path of the tools directory to the end of the existing Path variable, and click "OK." You should now see the new version of the variable in the displayed list. Click "OK" and then "OK" again to exit the dialog boxes.

On Linux, the PATH environment variable can be defined in your ~/.bashrc ~/.bash_profile file. If you have either of those files, use a text editor such as gedit, vi, or Emacs to open the file and look for a line that exports the PATH variable. If you find such a line, edit it to add the full path of the tools directory to the path. If there is no such line, you can add a line like this:

export PATH=${PATH}:your_sdk_dir/tools
where you put the full path in place of your_sdk_dir.

On Mac OS X, look for a file named .bash_profile in your home directory (note the initial dot in the filename). If there is one, use an editor to open the file and look for a line that exports the PATH variable. If you find such a line, edit it to add the full path of the tools directory to the path. If there is no such line, you can add a line like this:

export PATH=${PATH}:your_sdk_dir/tools
where you put the full path in place of your_sdk_dir.

Install the Android plug-in (ADT): Throughout this book, we will make use of the Android Development Tool plug-in that Google supplies for use in building Android applications. The plug-in is installed in much the same way as any other Eclipse plug-in:

Start Eclipse, if it's not already running.

From the menu bar, select "Help Software Updates Find and Install...".

In the Install/Update dialog, select "Search for new features to install" and click on "Next."

In the Install dialog, click on "New Remote Site." A "New Update Site" dialog pops up. Enter a name for the plug-in ("Android Plugin" will do), and the URL for updates: . Click "OK."

The new site should now appear in the list of sites on the Install dialog. Click "Finish."

In the Search Results dialog, select the checkbox for "Android Plugin Developer Tools" and click "Next."

The license agreement for the plug-in appears. Read it, and if you agree, select "Accept terms of the license agreement" and click "Next." Click "Finish."

You will get a warning that the plug-in is not signed. Choose to install it anyway by clicking "Install All."

Restart Eclipse.

After Eclipse restarts, you need to tell it where the SDK is located. From the menu bar, select "Window Preferences." In the Preferences dialog, select "Android" in the left column.

Use the "Browse" button to navigate to the place you installed the Android SDK, and click on "Apply," then on "OK."

Congratulations—you have installed a complete Android development environment without spending a penny.

Friday, June 4, 2010

Lets start with configuring Android with eclipse

Hello Android Beginners , its time to explore the vast utilities of Android platform .

If you want to become an Android Developer then this is the right place .

Before doing Android programming , you should configure your eclipse with the Android SDK which can be found at Android Official Website .

Download the latest SDK and follow the instruction as directed which can be found at Android Installation .

The requirements that you must have :

1. Java (jdk 6 would be better).
2. Eclipse IDE.
3. A good knowledge of Object Oriented programming like Java.
4. Internet Connection .
5 . OS(windows,mac,linux ... I would prefer Windows because I have done it in Windows till now. But you can try it on other Operating Systems...Who cares !!!).

Note : If you dont have Internet Connection then , Download the Android SDK 1.5 r3 from the Android Site . Then download ADT plugin 0.9.5 from this Android Site and follow the instructions .

Try it first before going into Android Programming !!

Happy Android programming !!!

Wednesday, May 26, 2010

Android Tutorials for Beginners !!!

I am feeling very good to say that from this week i would be able to give you some Android Tutorials such that you all can practice on your own.

However, there are many websites from where you can get Android programming tips , but i will try my best to provide you all , the knowledge about Android in a systematic and effective way.

Be ready to travel to a new world of Android....

Happy Android Programming !!!!