I am trying to find a tool, if there is one, to help in creating/optimizing images to be used as backgrounds for Android Buttons. Is there a certain size, as a general rule, that the image to be used for the background should be, and are there any good programs (free preferably) that I can use?
Share
For a button background you will need to create a 9-Patch image, this is a small piece of the design with areas marked as ’tile able’ by the Android interface, look here for an accurate definition:
http://developer.android.com/reference/android/graphics/NinePatch.html
for a tool to help turn your PNG’s into 9 Patch images use this
http://developer.android.com/guide/developing/tools/draw9patch.html
You will of course then need to make an XML file for the background drawable and define the states but then your sorted.
GUIDE: http://ogrelab.ikratko.com/custom-color-buttons-for-android/
EDIT:
For JUST simply an icon, create them in these density’s
36×36 for low-density (ldpi)
48×48 for medium-density (mdpi)
72×72 for high-density (hdpi)