Back in my Build a Mobile Dude App with PhoneGap and jQuery Mobile post I walked you through the creation of my mobile Dude app using PhoneGap and jQuery Mobile, focusing for now on the Android platform.
To add a custom icon to your app, you’ll need an icon in three sizes (for low, medium and high density), 36×36, 48×48, & 72×72. Once you have these, you’ll want to put them into your project. Give them all the same name, but put them in different folders:
- 36×36 -> res/drawable-ldpi/icon.png
- 48×48 -> res/drawable-mdpi/icon.png
- 72×72 -> res/drawable-hdpi/icon.png
After you’ve done that, open your AndroidManifest.xml file, and look for the following lines:
Change that “@drawable/ic_launcher” to “@drawable/icon” – this tells Android to look for the image called icon.png in the appropriate folder based on the device (finding a low, medium or high density image).
We have now added a custom icon to our application!
Safari Books Online has the content you need
Check out these Phonegap books available from Safari Books Online:
|PhoneGap Beginner’s Guide, written by Andrew Lunny, the author of this post, will show you how to use the PhoneGap mobile development framework to target multiple mobile platforms: iOS, Android, BlackBerry, and more with a single application. With PhoneGap, you can use existing web development skills, instead of learning a new environment for every platform on the market.|
About the Author
|Duane O’Brien is a tired computer scientist. He has written a number of articles on developing web applications and various PHP frameworks. To learn more about Duane, check out his blog or read his tweets.|