Draw 9patch

Write App Reviews

Build your own Android App Dev Empire

Get Instant Access

The Draw 9-patch tool allows you to easily create a NinePatch graphic using a WYSIWYG editor.

For an introduction to Nine-patch graphics and how they work, please read the section on Nine-patch in the Ninepatch Images topic.

Here's a quick guide to create a Nine-patch graphic using the Draw 9-patch tool. You'll need the PNG image with which you'd like to create a NinePatch.

1. From a terminal, launch the draw9patch application from your SDK /tools directory.

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. Click within the 1-pixel perimeter to draw the lines that define the stretchable patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase previously drawn lines.

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

Android Border Nes Sample Code

Note: A normal PNG file (*.png) will be loaded with an empty one-pixel border added around the image, in which you can draw the stretchable patches and content area. A previously saved 9-patch file (*.9.png) will be loaded as-is, with no drawing area added, because it already exists.

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.

V 4QL~^fl

Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.

Site Terms of Service - Privacy Policy - Brand Guidelines

! Go to top

Android Emulator

The Android SDK includes a mobile device emulator -- a virtual mobile device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device.

The Android emulator mimics all of the typical hardware and software features of a typical mobile device, except that it can not receive or place actual phone calls. It provides a variety of navigation and control keys, which you can "press" using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other Android applications running.

To let you model and test your application more easily, the emulator supports Android Virtual Device (AVD) configurations. AVDs let you specify the Android platform that you want to run on the emulator, as well as the hardware options and emulator skin files tht you want to use. Once your application is running on the emulator, it can use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data, notify the user, and render graphical transitions and themes.

The emulator also includes a variety of debug capabilities, such as a console from which you can log kernel output, simulate application interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and dropouts on the data channel.

In this document: Overview

Starting and Stopping the Emulator

Android Virtual Devices and the Emulator

Controlling the Emulator Emulator Startup Options

Working with Emulator Disk Images

Default Images

Runtime Images: User Data and SD Card

Temporary Images

Emulator Networking

Network Address Space Local Networking Limitations Using Network Redirections Configuring the Emulator's DNS Settings Using the Emulator with a Proxy Interconnecting Emulator Instances Sending a Voice Call or SMS to Another Emulator Instance

Using the Emulator Console

Port Redirections Geo Location Provider Emulation Sending Events

Emulating Device Power Characteristics

Network Status

Network Delay Emulation

Network Speed Emulation

Telephony Emulation

SMS Emulation

VM State

Emulator Window

Terminating an Emulator Instance

Using Emulator Skins

Running Multiple Instances of the Emulator

Installing Applications on the Emulator

SD Card Emulation

Creating an SD card image using the android tool Creating an SD card image using mksdcard Copying Files to a Disk Image Loading the Disk Image at Emulator Startup

Troubleshooting Emulator Problems

Emulator Limitations

Was this article helpful?

0 -2

Post a comment