Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android notification big picture dimensions

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

like image 539
ArchOrn Avatar asked Mar 18 '15 10:03

ArchOrn


People also ask

How do I make Android notifications full screen?

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.

How do you set a notification picture on android?

To add an image in your notification, pass an instance of NotificationCompat. BigPictureStyle to setStyle() .


1 Answers

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.

like image 164
Jake Lee Avatar answered Sep 20 '22 21:09

Jake Lee