Using an icon for your application

According to Google's Our Mobile Planet data (http://services.google.com/fh/files/blogs/our_mobile_planet_us_en.pdf), an average Android downloads 26 applications in addition to the already-installed ones. So, we can easily assume that your application will be hidden somewhere in the other 40-50 applications of your users. How can we catch the eyes on both the Android market and the applications' menus? This can be done using a recognizable icon. This recipe will show you how to change the default icon on Android.

Getting ready

For this recipe, we will continue to use the project created for the previous recipes.

How to do it...

Using the following steps, we will see how to use an icon in our application:

  1. Find or create a logo representing your application/company.

    We will use the following icon:

    How to do it...
  2. Place your logo under the Resources/drawable folder.
  3. Modify your AndroidManifest.xml file under Properties folder as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="Splash.Splash">
      <uses-sdk/>
      <application android:icon="@drawable/icon_name" android:label="Splash"></application>
    </manifest>

    All attributes but android:icon should already be in the file.

  4. Deploy your application on the emulator again.

Tip

If you are confronted with an error involving "not found resource in drawable", try to clean/rebuild your project after checking that there is no misspelling in the icon's name.

The application will start as usual, however, if you browse back by pressing the Home button or the Back button, you will be able to access the application menu and see the new logo, as shown in the following screenshot:

How to do it...

Tip

You may have to restart your emulator to see the new logo as all files are not transferred each time. You may also try to uninstall the application on the phone.

How it works...

There is not much to understand about icons. Icons are images with a 48 x 48 pixel size. The default icon of your application will look like this:

How it works...

This image is stored under the Resources/drawable/Icon.png folder. This picture is used both for the Android Play Store and the application menu on the phone.

There's more...

Here is some additional information recommended by Google.

Google Play Store icons

The required size of Google Play Store icons—the ones that the users will see while browsing through the market—is 512x512 px, due to the ability of users to browse through the market using a laptop and not only a phone. This logo will be demanded by Google while submitting your application to the market.

Keeping this in mind, I encourage you to design your icons using vectors capable software, such as Abobe PhotoShop.

Designing trick

In order to get a bigger visual impact, your icons should be a distinct three-dimensional silhouette. Also, your icons should have a little perspective, as if viewed from above. This way, users will be able to see depth in your icons and therefore, they will be highlighted compared to the background and other icons around.

See also

Iconography is a wide domain, you can find more on this at http://developer.android.com/design/style/iconography.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.228.35