The use of 9 patch images for Android development is to help keep the app lower in the size. We can use 9 patch images for the buttons & backgrounds.
9patch image works like the scalable Graphic in the android & we can define the scalable area of the image. It has a slightly different approach in creating the 9patch images.
Scalable Area: Scalable area defines the area which is going to be scaled as per the content. The black patch to the Left & Top side of the image defines vertical & horizontal scaling area respectively.
Fill Area: It defines the drawable area where content is going to be filled in. The black patch of the Right & Bottom side of the image defines vertical & horizontal fill area respectively.
Kindly note that, to recognize 9patch image in Android, you must use image extension such as the following,
imageName.9.png
(The number 9 helps to identify the 9 patch image)
Creating 9 patch background image using Photoshop:
Draw the images in a regular way as you use to do in Photoshop.
Select the Rectangular marquee Tool & draw the 1px wide & required scalable height selection to the Left of the image. Add the new layer & fill the black color to the selection.
Image Courtesy- Abhijit Kurane
You can find more information about how nine patch images work from the links below,
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
http://radleymarx.com/blog/simple-guide-to-9-patch/
Also you can try some online tools such as the- http://draw9patch.com/