Android Question Select App Icon Depending Resolution

BitsAndBytes

Active Member
Licensed User
Is it possible to use a resource file to make your app select icon depending on mobile device resolution ? mdi, hdpi, xhpi, xxhpdi, xxxhpdi ?

Thank you!
 

Misterbates

Active Member
Licensed User
I used the material icon website https://materialdesignicons.com/ to find an icon that was close to what I wanted, then downloaded the icon package (zip file). Inside the zip there are a number of folders (one per resolution) and in each folder, there are black, white and grey versions of the icon at various sizes (18dp, 24dp, 36dp etc.).

I extracted the black 24dp files into the folders named in the zip, with all folders under the <app>/objects/res folder (which now has subfolders named drawable, drawable-mdpi, drawable-hdpi etc.). Once all the files were extracted, I used Paint.net to customize the images while retaining the transparent parts.
 
Last edited:
Upvote 0

Misterbates

Active Member
Licensed User
Couple more things. The standard filename for the app icon is icon.png. I have the following in manifest editor
B4X:
SetApplicationAttribute(android:icon, "@drawable/icon")
and then I include a custom build action to ensure all files in res and subfolders are read-only (as described by Erel elsewhere in the forum)
 
Upvote 0
Top