My android app is responsive, but my icons aren’t !

That is one of the most recurring aspects I think of while writing an app on android.
Because of the folder hierarchy, which is not likely to accept vector graphics under Android 5.0 (Lollipops), it can be a repetitive task to scale each icon using each resolution (ldpi, mdpi, hdpi, xhdpi, xxhdpi).

Then I found this simply stupid idea to make each icon once : create it using a vector graphics software (inkscape is free, but there is also adobe illustrator), put it in a separate folder than use a maven goal to generate the drawables.

Here is the plugin configuration I made in my current Android app :

Then remove the non-vector pics from your SCM. If your needs it, pick up a free API to render it at runtime :<github_author>/<github_repo>/<github_branch>/pathtosvg

You can see a working example of this idea on my current project :

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *