A (175)

(Tuis.) #1
CHAPTER 3: An Introduction to the Android Application Development Platform 85

Not surprisingly, you do this by giving your icon an exact name and file format, and putting it into
an exact directory. When Android finds an icon file there, it automatically puts it into play as your
application’s icon. These files must follow these rules (defaults) precisely:


   Be placed in the correct /res/drawable-dpi folder, which holds all of the drawable
resources for that screen density resolution
 Be named launcher_ic.png (we will learn how to change this in the next chapter
on XML)
 Be a PNG file with an alpha channel (transparency), so that the icon overlays on
any system background wallpaper seamlessly

In this section, I’ll use my 3D company logo and an Android green hue, but you can use any image
that you like. Also, I will use GIMP 2.8 for this image editing example, since all readers will have it
installed, but you can use any image-editing program you prefer, such as Photoshop CS6 or Corel
Painter. So let’s fire up the GIMP software package that we installed in Chapter 1 and create a PNG
file with transparency. We will be getting into transparency (alpha channels) in detail in the graphic
design chapter later on in the book.


Creating Transparency: Edit the Image in GIMP


The first thing we need to do is to put the logo onto a transparency layer, and remove the white color
from the current graphic design. Here are the steps to remove the white background from the Mind
Taffy Design logo:



  1. Use the GIMP File ➤ Open menu sequence to open the
    MindTaffyLogoAndroidGreen.gif logo file. The graphic image is currently 200
    by 200 pixels, and is actually the first frame of an Animated GIF file that is
    utilized on my WallaceJackson.com web site

  2. Select the “Select By Color” tool (fifth in the toolbar) and set the tolerance at
    15 (bottom-middle tool tab for Select by Color tool settings) and the Select
    By to Composite. Make sure the Anti-Aliasing option is checked as well and
    then click the white area to select it, as shown in Figure 3-10.

Free download pdf