Is there a way to set and app icon for Samsung devices specifically?
Asked Answered
E

2

8

I noticed that the Samsung apps have a specific shape; for example, the Gallery, Camera, Phone, Messages and Internet app icons below.

enter image description here

Is there a way to specify an icon for Samsung devices only? Something similar to how the new Google Pixel uses the android:roundIcon attribute in the manifest?

I tried looking for something in the Samsung Developer documentation, but there does not seem to be anything on the topic.

The devices do have a way of recognizing the Samsung apps, considering the Icons with backgrounds setting [Settings > Display > Icon backgrounds] enables a similarly shaped background for all other apps. For example, the Google Play Store icon below.

enter image description here

But I am unsure if this is a publicly-available option.


This question would be inconsequential if Samsung adopts Android Oreo's new adaptive icons; but as far as I know they haven't yet.

Ethe answered 16/2, 2017 at 16:8 Comment(0)
S
9

You can disable TouchWiz to surround your application icon in a rounded square frame by setting

<application>
    <meta-data android:name="com.samsung.android.icon_container.has_icon_container" android:value="true"/>
</application>

to your AndroidManifest.xml

Shift answered 15/12, 2017 at 14:39 Comment(1)
Interesting. From what I can tell, that just tells TouchWiz not to surround the icon in a rounded circle when the option is enabled (i.e. the Google Play Store icon mentioned in my question). It still doesn't give me the ability to provide a Samsung-specific app icon though. But if Samsung recognizes this meta-data tag, I wonder what other tags they recognize. Would you happen to know of any others? Is there any official documentation on the subject (I couldn't find any)?Ethe
W
2

To detected if you are running in a Samsung device is easy:

android.os.Build.MANUFACTURER == "samsung"

More info here

So after you have defined that you are running in a Samsung device, you could change your app to change the app icon programatically when running in Samsung devices. But unfortunately android doesn't provide a way of doing it.

There are some work arounds to change de app icon, you can check here, here and here

If you really need to change your icon, you can try the workarouds, but if is just to keep in standard with the non-standard samsung icons, them I would not do it ;)

Weems answered 16/2, 2017 at 16:24 Comment(1)
This would work, but I was hoping for something a bit less hacky. Not to mention the fact that the INSTALL_SHORTCUT workaround creates a Toast when a new shortcut is installed/uninstalled. I think I'll keep the icon as-is, unless a better option becomes available from Samsung.Ethe

© 2022 - 2024 — McMap. All rights reserved.