Android Question Notification Icon not fill

Vincenzo

Member
Licensed User
Longtime User
in this code

Dim n As Notification
n.Initialize
n.Icon = "icon"
...

the icon of notified is moore great (icon 512x512) and not fill,in the management of notifications you see only a part of the icon.
 

bsnqt

Active Member
Licensed User
Longtime User
If you do a search in the B4A forum, you can easily find the answer. There were many topics discussing on how to use different sizes of .png for best display of icons. It will work for this case (notification) as well. You will need to use the following sizes: 32x32 (ldpi), 46x46 (mdpi), 72x72 (hdpi) and 96x96 (xhdpi).
 
Upvote 0

Vincenzo

Member
Licensed User
Longtime User
In thread "Several services and their notify icons":
----------------
But how to swap icons on a single notify?
>The image file should be manually copied to the following folder: source folder\Objects\res\drawable.

Notif1.Icon = "icon2", but if i place "icon2.png" into "Objects\res\drawable" of source codes - this file is deleted during re-compiling by B4A v.1.7.

EDIT: HA, "read only" flag on this file helps...;-) but it's non-documented trick :)
-----------------
not a good idea used two file png icon and icon2 into "Objects\res\drawable" ? icon2.png is delete and so not right....
 
Upvote 0

Vincenzo

Member
Licensed User
Longtime User
ok thanks.
but if I want to change the resolution of the icon depending on the display you use the manifest file should I use?
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
No, depending on the screen resolution (if you follow correctly the Android's guideline), the system will automatically use the best icon size. If you are talking about the icon size of your app, then put different sizes in the folders, as I mentioned earlier:
Objects\res\drawable-ldpi
Objects\res\drawable-mdpi
Objects\res\drawable-hdpi
Objects\res\drawable-xhdpi
But if you talk about the notification image itself .png (what to display), you can still change it programatically: assign it with the icon you want n.Icon = "icon", the system will decide which size it will use (if all sizes are available).
 
Upvote 0

Vincenzo

Member
Licensed User
Longtime User
Ok thanks for the info.
But in b4a i have only :

\Objects\res\drawable

in this case the images as the wear? how to manage them B4A this distinction?
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
You have to create the relevant folders with those names yourself and create the icons then put the icons with different sizes accordingly as I described above.
 
Upvote 0

Vincenzo

Member
Licensed User
Longtime User
Thank you,
it seems that everything works!
for xhdpi I put a higher resolution 512x512 and it shows no problems.
If you do not respect the standard 96x96 I have problems publishing the app in the Android store?
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
Vincenzo: Just try yourself (I did not try yet), but logically I don't think there will be any prob... They give special requirements only for those icons that are used with banners displaying out to the users only.
 
Upvote 0
Top