Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,650 Members 39,080 Now Online
XDA Developers Android and Mobile Development Forum

[APP][2.3+] Tool - App Icon Detective

Tip us?
 
Dark3n
Old
(Last edited by Dark3n; 21st June 2014 at 08:02 PM.)
#1  
Dark3n's Avatar
Recognized Developer - OP
Thanks Meter 2043
Posts: 1,949
Join Date: Sep 2007
Default [APP][2.3+] Tool - App Icon Detective

What?
A small tool that asks every installed app for its icon and compares the returned with the icon it would expect for that type of display.

Why?
Android has a system of specific folders relating to different display densities (ldpi,mdpi,hdpi,xhdpi,xxhdpi,xxxhdpi).
Also see Android Iconograhy.
Android tries to pick the best possible resource out of those folders.
If one resource for a specific density is missing it will pick the closest one and scale it up/down.

Example:
A dev puts the Google Play highres (512x512) version of his app icon that is normally for the web,
in the folder (inside the apk) "drawable" (which is treated as mdpi, i.e. 48x48dp for the launcher icon).
The user opens this app on his Nexus5 (which has a screen density of type xxhdpi [factor 3.0 of mdpi] by default).
Android only finds the app icon in the folder "drawable" and scales it up to match the xxhdpi density used on the Nexus5.
This means that the resulting image that gets returned is 512px x 512px scaled up by 3.0, so a 1536px x 1536px image.
(Thats huge in comparison to the 144px x 144px it expected).

Okay, but why?
It's an interesting issue i wanted to look into.
If your App or ROM or Mod or Plugin or WhatEver is not prepared for this it may crash. (Usually due to running out of memory)
If you suspect it could be the cause for a mysterious crash you are experiencing, you can use this app to check for stuff out of the ordinary.
A logcat would have shown "OutOfMemory" exception while mentioning image/appicon related methods in the stacktrace.
(Will post an example when i find one).

How do i interpret the results?
Look at the % displayed in the corner of each row and the color code.
I wouldn't worry about an icon that is ~400% of the expected size, there's room for improvement but its not critical.
But if you get an app with an icon 11377% of the expected size such as in my screenshot, that's a pretty hefty difference.
You could send the dev mail asking him politely if he could check it out.
No one does it with malicious intent, sorting in the drawables in the correct folders is a PITA and you don't notice it later on.

The sourcecode for this app is available on Github.

Screenshot:
Click image for larger version

Name:	2014-06-21 18.21.06.jpg
Views:	326
Size:	205.9 KB
ID:	2810592
Attached Files
File Type: apk AppIconDetective_v1.0_(1).apk - [Click for QR Code] (885.1 KB, 139 views)
The Following 4 Users Say Thank You to Dark3n For This Useful Post: [ Click to Expand ]
 
Dark3n
Old
#2  
Dark3n's Avatar
Recognized Developer - OP
Thanks Meter 2043
Posts: 1,949
Join Date: Sep 2007
The whole dpi stuff is very confusing, if I'm wrong with my explanation please let me know.
Maybe another dev or themer is more familiar with the topic and can shed more insight into the issue.
 
Vagelis1608
Old
#3  
Vagelis1608's Avatar
Senior Member
Thanks Meter 45
Posts: 304
Join Date: Sep 2012
Location: Athens
Very cool app.
And usefull.

PS: Why is your SystemUI at 2422% ?
EDIT: Mine is too. I don't get it. Someone please explain it to me.

Sent from my D620R [Stock 4.4.2]
Click the "Thanks" button if Ihelped!


Click on the image!

==========

Current Devices:
Samsung Galaxy 5 Europa (GT-I5500) [CM11] --Rooted--
Samsung Vodafone 360 H1 (GT-I8320) [CM7.2] --Rooted--
LG G2 Mini (LG-D620r) [Stock 4.4.2] --Not Rooted-- w/ Xposed installed, for more info click here

==========

Translated Apps (to Greek):
SD Maid
[Xposed] App Settings
 
ivan123
Old
#4  
Senior Member
Thanks Meter 576
Posts: 217
Join Date: Jan 2010
Great tool for developers

 
Dark3n
Old
#5  
Dark3n's Avatar
Recognized Developer - OP
Thanks Meter 2043
Posts: 1,949
Join Date: Sep 2007
Quote:
Originally Posted by Vagelis1608 View Post
Very cool app.
And usefull.

PS: Why is your SystemUI at 2422% ?
EDIT: Mine is too. I don't get it. Someone please explain it to me.

Sent from my D620R [Stock 4.4.2]
I think thats where Google tried to "efficiently store" the KitKat logo.
If you go into System->Settings and tab the Android version a lot, there will be an animation and a graphic and that graphic is the huge one that's also the SystemUI icon.
Attached Thumbnails
Click image for larger version

Name:	2014-06-25 11.50.31.png
Views:	45
Size:	70.9 KB
ID:	2816759  
The Following User Says Thank You to Dark3n For This Useful Post: [ Click to Expand ]
 
Vagelis1608
Old
#6  
Vagelis1608's Avatar
Senior Member
Thanks Meter 45
Posts: 304
Join Date: Sep 2012
Location: Athens
Quote:
Originally Posted by Dark3n View Post
I think thats where Google tried to "efficiently store" the KitKat logo.
If you go into System->Settings and tab the Android version a lot, there will be an animation and a graphic and that graphic is the huge one that's also the SystemUI icon.
So, the only reason your SystemUI is at 2422% and mine at 9k + something (lol) is because of that one image?

And by the way, I know about the "Easter Egg"

Sent from my D620R [Stock 4.4.2]
Click the "Thanks" button if Ihelped!


Click on the image!

==========

Current Devices:
Samsung Galaxy 5 Europa (GT-I5500) [CM11] --Rooted--
Samsung Vodafone 360 H1 (GT-I8320) [CM7.2] --Rooted--
LG G2 Mini (LG-D620r) [Stock 4.4.2] --Not Rooted-- w/ Xposed installed, for more info click here

==========

Translated Apps (to Greek):
SD Maid
[Xposed] App Settings
 
Dark3n
Old
#7  
Dark3n's Avatar
Recognized Developer - OP
Thanks Meter 2043
Posts: 1,949
Join Date: Sep 2007
Quote:
Originally Posted by Vagelis1608 View Post
So, the only reason your SystemUI is at 2422% and mine at 9k + something (lol) is because of that one image?

And by the way, I know about the "Easter Egg"

Sent from my D620R [Stock 4.4.2]
Yeah I think so, because they used the same image as icon.

Sent from my Nexus 5 using XDA Premium 4 mobile app
The Following User Says Thank You to Dark3n For This Useful Post: [ Click to Expand ]
 
debernardis
Old
(Last edited by debernardis; 10th July 2014 at 12:17 PM.)
#8  
debernardis's Avatar
Senior Member
Thanks Meter 113
Posts: 443
Join Date: Jun 2011
Location: Acireale, Sicily
Here are my red results (3 pics)

Galaxy Note 2, 4.1.2 stock firmware, n.e.a.k. kernel, xposed framework



Sent from my GT-N7100 using XDA Premium 4 mobile app
Attached Thumbnails
Click image for larger version

Name:	1404990506288.jpg
Views:	32
Size:	95.2 KB
ID:	2843737   Click image for larger version

Name:	1404990525274.jpg
Views:	34
Size:	90.1 KB
ID:	2843738   Click image for larger version

Name:	1404990542165.jpg
Views:	33
Size:	81.9 KB
ID:	2843740  
Ernesto de Bernardis
[Galaxy Note]

The Following User Says Thank You to debernardis For This Useful Post: [ Click to Expand ]
Tags
dpi, drawable, icon, resolution, tool
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes