My Life with Android
Introduction Android Componets UserInterface Advanced UI Data Storage Advanced Concepts Others New Studio

What is DDMS?

Android provides a debugging tool called the Dalvik Debug Monitor Server (DDMS). Advantages of DDMS : Screen capture on the device,Logcat. How DDMS works : To use DDMS open the perspective DDMS : go to
Window->Open Perspective->Other, DDMS

Creating and launching android AVD emulator in eclipse

What is Android Virtual Device (AVD)?
An emulator acts as a real Android device (in most cases) and allows us to run and test the application without having a real device.

  • 1. Before launching the emulator, you must create an Android Virtual Device (AVD) which defines the system image and device settings used by the emulator. Some of the settings are,
    • configure the version of the Android system
    • size of the SD card
    • set of hardware options
    • emulator skin
    • screen resolution, etc
  • 2. You can define several AVD with different configurations and can start them in parallel.
  • 3. Starting a new emulator is very slow, because the file system of the new AVD needs to get prepared.

Installing an Android System Image (Required)
Before you create an Android emulator, you need to install an Android system image that your emulators can use.

Follow these steps:
1. Start the Android SDK Manage
2. In the packages tree, locate and check the ARM EABI v7a System Image node within the first Android node in the list.
For example: Android 4.2.2 (API 17) or Android 4.3 (API 18) Chania
3. Click Install 1 package. (Clear any checkboxes that were auto-selected.)
4. In the Choose Packages to Install page, click Accept License, and then click Install to install the system image.

Google API
If your application uses functionalities provided by Google API such as, Google Maps API, Cloud to Device Messaging (C2DM) then you must create an AVD created for the Google API's.
Creating an Android Emulator Using the Android Virtual Device Manager
Follow the steps below to create a new AVD,
1. In Eclipse, select Window -> AVD Manager.
2. Click New

The Create New AVD dialog appears. Type the name of the AVD, for example first_avd.
Choose a target.(The target is the platform (that is, the version of the Android SDK, such as 2.3.3) you want to run on the emulator. It can be either Android API or Google API)
[Optional] an SD card size, say 400
[Optional] Snapshot.Enable this to make start up of emulator faster.
[Optional] Skin.
[Optional]You can add specific hardware features of the emulated device by clicking the New button and selecting the feature.
Click Create AVD.

Launch Android AVD (Emulator)
After creating a new Android AVD, you can launch it using Android AVD Manager. Open Android AVD Manager either from Installation directory or Eclipse IDE and follow the steps as shown below.


Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.


Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Draw 9-patch

The Draw 9-patch tool is a editor that allows you to create bitmap images that automatically resize to accommodate the contents of the view and the size of the screen.Selected parts of the image are scaled horizontally or vertically.

Here's a quick guide to create a NinePatch graphic using the Draw 9-patch tool. You'll need the PNG image with which you'd like to create a NinePatch image.
  • 1. From a terminal, run the draw9patch command from your SDK sdk/tools directory to launch the Draw 9-patch tool.
  • 2. Drag your PNG image into the Draw 9-patch window (or File > Open 9-patch... to locate the file). Your workspace will now open.

    The left pane is your drawing area, in which you can edit the lines for the stretchable patches and content area. The right pane is the preview area, where you can preview your graphic when stretched.

  • 3. When done, select File > Save 9-patch...

    Your image will be saved with the .9.png file name.

Optional controls include:
  • Zoom: Adjust the zoom level of the graphic in the drawing area.
  • Patch scale: Adjust the scale of the images in the preview area.
  • Show lock: Visualize the non-drawable area of the graphic on mouse-over.
  • Show patches: Preview the stretchable patches in the drawing area (pink is a stretchable patch).
  • Show content: Highlight the content area in the preview images (purple is the area in which content is allowed).
  • Show bad patches: Adds a red border around patch areas that may produce artifacts in the graphic when stretched. Visual coherence of your stretched image will be maintained if you eliminate all bad patches.