Managing graphic assets can be a time-consuming task for Android developers. Even the simplest Android app needs several graphic assets — the launcher icon in the various densities. Any reasonably complex app will contain many more assets, and each type of icon has different size requirements. Some even change across Android versions, making it more difficult to manage a large set of graphics.
Luckily, the Android Asset Studio (Chrome browser is required to use the tool) can automatically generate a number of different graphic assets for your app. It knows the right sizes for each icon type, for each Android version. Even better, this tool has been integrated into the Android Developer Tools (ADT) to allow seamless integration of new assets into your app.
What assets can be generated
While the Android Asset Studio wizard has been integrated into the ADT for a few versions, there have been some updates. I will focus on the options available in ADT 20.0.3 (released August 2012).To access the wizard in Eclipse, go to New | Other | Android Icon Set (Figure A). Figure A
- Launcher Icons
- Menu Icons
- Action Bar Icons
- Tab Icons
- Notification Icons
Note that while the wizard indicates Action Bar icons are for Android 3.0+, the icons generated here are compatible with ActionBarSherlock as well.
Each icon type has different options that are appropriate to the type of icon and the target version of Android for your project. For more walk-through and details on this wizard, read the Asset Studio announcement on the developer tools page.
After selecting all of the appropriate options and clicking to finish, the appropriately-sized icons will be added to each of the density folders under /res. In the case of the launcher icon, a 512x512 image will also be placed in the root of the project.
All of the icons are in their appropriate locations, and the app will automatically use the appropriate ones on each device.
When to generate image assets
The good news about this is you can maintain just your full-resolution original images outside of Eclipse rather than maintaining a version at each density; plus, you are prepared as new densities are introduced (as with xhdpi and xxhdpi, which came out with the new Android 4.2). When the Android Asset Studio wizard is updated, you can re-generate the icons from the source asset quickly and easily.
In addition, this wizard helps manage the complexity of the different asset requirements across Android versions. For example, the status bar icons changed between Android 2.2 and 2.3.
This also means it is easy to bring in in-work graphics (even multiple revisions) while developing the app. The stand-in graphics will be at the right densities, making it easier to visualize how the app will look when the final graphic assets are brought in.
When automatic generation is not the best option
Automatic generation of images is a convenience; I suspect many developers value this convenience over the pixel precision of hand-generating each image. However, if only the very best is acceptable, automatic generation can't stand up to the precision and attention to detail of an experienced graphic artist. Applications with a bigger budget may not want to use the automatic generation for final graphics, even if they use it to simplify integration of in-work graphics.
In addition, this tool focuses on icons, which have defined sizes. Scalable graphics and other custom-size images still must be attended to manually.
I hope the Asset Studio wizard will help simplify your efforts to manage icon assets for your Android apps. The tool has been useful in my Android app development work.
Tim Mackenzie, author of the Android Income Series books, is a software engineer that escaped the cubicle world at a large company to go solo with Android app development. He uses this freedom to teach others how to make money with Android apps. Visit the ProjectJourneyman.com blog for the information you need to start earning with Android apps.apps.