Posted on by & filed under Content - Highlights and Reviews, Mobile Development.

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.
Using HTML, CSS, and Javascript, PhoneGap allows you to jump into the mobile world and develop apps for iPhone, Android, and the BlackBerry, and Beginning PhoneGap will help show you how to best take advantage of PhoneGap.
Beginning PhoneGap: Mobile Web Framework for JavaScript and HTML5 is a definitive, one-of-a-kind book that teaches the fundamentals and strategies behind cross-platform mobile application development. Instead of learning languages like Objective-C, focus on building apps from day one for Android, iOS, Blackberry, WebOS and Symbian—without the complexities of these platforms.

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.

Tags: android, custom icon, PhoneGap,

Comments are closed.