Sunday, April 11, 2010

The Missing Manual - Android Drawables from XML

I have been fairly frustrated with a gap in the Android documentation recently - the file formats for creating Drawables from XML. Drawables XML has been pretty useful to me in the past in creating gradients; I'd rather use it than create 9-patches all the time. However, the Android documentation is strangely silent about the format; they provide a few samples, but as far as I know there's nothing beyond that.

I've taken it upon myself to study the source code and create a missing manual for all the possibilities for Drawable XMLs. The data was gathered from the Android source code, from the android.graphics.drawables package. I was surprised to find a lot of really useful code I wish I'd known about a long time ago; regardless, I was able to figure out all of how Drawables XML works.

Without further ado, here it is: the missing manual on Android Drawables via XML. I hope this lessens the pain someone else has slightly.

11 comments:

  1. Epic, I have been looking for something like this for months now. I was already about to take apart the source code myself while researching this for a book I am writing, but looks like you saved me from an evening of frustration. Consider yourself included in the awesome-people-we-like-to-thank-list of one of the better forthcoming Android books :-)

    ReplyDelete
  2. Maybe useful but without example and no explanation ...

    What are Android drawables from XMl and why are they better than 9Patch ?

    ReplyDelete
  3. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in btm

    angularjs Training in electronic-city

    angularjs Training in online

    ReplyDelete
  4. Hi,
    Good job & thank you very much for the new information, i learned something new. Very well written. It was sooo good to read and usefull to improve knowledge. Who want to learn this information most helpful. One who wanted to learn this technology IT employees will always suggest you take python training in bangalore. Because python course in Bangalore is one of the best that one can do while choosing the course.

    ReplyDelete
  5. I learnt somthing which is very interesting Nowadays there is a good scope on azure. microsoft azure training will be helpful to learn on azure

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. http://daniel-codes.blogspot.com/2010/04/missing-manual-android-drawables-from.html

    ReplyDelete