I'm trying to find the exact dimensions of the big picture style image on Android notification. Indeed, I need those in order to compute images on-the-fly at the right dimensions to avoid too big downloads in my application.
I've made some tests and, for example, I can't take the width of the screen as the width of my image because the notification center does not fit entirely the screen on tablets.
Is there any way to get those dimensions as we do for the large icon with android.R.dimen.notification_large_icon_width
and android.R.dimen.notification_large_icon_height
?
Thanks
Notify while the app on the foreground. In order to show a full-screen intent, we need to first build the notification and set the full-screen intent to the notification. To build the intent we need a pending intent, which can be achieved using PendingIntent.
To add an image in your notification, pass an instance of NotificationCompat. BigPictureStyle to setStyle() .
Based on the documentation from OneSignal, a popular notification library:
The image should be a 2:1 aspect ratio, but your main content should be in 43:24 ratio (~1.79) as some devices crop past this width. Android does not have a size limit, however see our recommended minimum, balanced, and maximum sizes below.
Minimum - 512x256 Balanced - 1440x720 Maximum - 2880x1440
So, 1440x720 seems optimal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With