Mayank
Mayank

Reputation: 1139

Where application icons are stored in an Android device?

Just out of curiosity, I wanted to know where on the file system of an Android device the application icons are stored.

Like I have shortcuts to various applications on the homescreen of my device, where those icons files (or images) are stored. Is it only inside the application package (.apk) or Android stores it some where else?

If it is in application package only does Android loads all the imagess from each of the apk and loads it when it is started for the first time?

Upvotes: 5

Views: 22886

Answers (2)

Ted Hopp
Ted Hopp

Reputation: 234857

When an app file is installed, the .apk file is analyzed and various items of information are extracted by the launcher. (This process does not involve loading and running the app itself.) Among these items is the app icon, which the launcher typically caches in its own private area. Exactly how this is done depends on the launcher currently active on your device. You might be able to browse through the source for your launcher to find out more details about how it caches these items extracted from the app .apk files, but I'm not sure what practical use there would be to that exercise.

The launcher's use of its own cache greatly speeds up start-up, as otherwise every installed app would have to be scanned at every reboot to extract the requisite information for the launcher to show itself. However, the cache is the source of occasional problems, such as the icon not updating right away when an updated app (with a new icon and possibly a new app name) is installed. (See, for example, this thread and this one.)

Upvotes: 2

Emmanuel
Emmanuel

Reputation: 13233

Think about what happens when you create your own app. Typically, you create icons for your app for all drawable resource buckets (or at least the ones you want to support). Then these files get packaged with AAPT into the apk with the rest of your project. Then after installing your app, the OS will pick the icon that matches your phone configuration and create a shortcut on your installed apps page.

Upvotes: 1

Related Questions