Default image Background

How is possible to change the background color during the time Android displays the default image ie before starting main.lua?

Because this startup image is displayed in letterbox, we have black bars on either side in landscape mode. The default image is white so changing the background at this time to white would help.

You will need to put in a feature request for this at http://feedback.coronalabs.com

Rob

Really? Wouldn’t call this a “feature”, more of a process.

Ya i think this can be done without a “Feature” Maybe @Rob misunderstood. Can you explain it a bit more as i don’t understand fully either.

Thanks!

–SonicX278

@sonicX278, thanks for taking a look. We need to have a white background instead of a black behind the default.png launch image before main.lua runs. IOS handles this with its selection of launch images based on screen aspect ratios. That’s not possible with the multitude of screen aspect ratios on Android devices. So defining background color at launch is required if you want to avoid the black background default.

On Android, we load a file called Default.png (no 2x, landscape, or any other versions) at the beginning of the Main activity. This is before main.lua runs. There is a gap of time between then where you get a black screen before your first frame update. Depending on how much stuff you do in  your main.lua, the time before that first frame update may be longer than you think.

You might be able to mitgate this by using display.setDefault( “background”, 1, 1, 1 )

see: https://docs.coronalabs.com/api/library/display/setDefault.html#color-keys

But it’s possible that might not even kick in until the first frame update, which is why I suggested a feature request. It might be possible to change how we address the Default.png to help get rid of that gap.

Another possibility, and this is Truly the Android way is to not use the Default.png at all. Use the excludeFiles section of your build.settings and don’t include it in your Android build. You will have a longer gray startup, but this is normal for Android apps as they don’t use Default.png’s anyway. This was something we did to make it more in-line with the iOS side due to developer demand. If you still want a splash screen load it as the first thing in main.lua. If you use display.newImageRect() you get to use @2x and @4x images if you have them. You can then load the rest of the things you do in main.lua and then remove the splash screen before you start showing your real screen.

Apple doesn’t like splash screens. They want the Default.png file to mimic the first screen the viewer sees to give the illusion the app is starting faster. While that’s Apple’s opinion, it make sense from an Android perspective too.

Rob

Thanks Rob. The best solution would be to allow the background color to be set in config or build. I could apply in feature request but that would be stretching the idea of a “feature”. When we are creating our framework we are always open to any way it can be easily tweaked to function more effectively. Is there another forum where ideas like these can be communicated to engineers?

We use http://feedback.coronalabs.com to track things users want to see added or changed about the framework. We use the number of votes as one metric in deciding where we spend engineering resources. These forums are great to talk about it. I can take things to engineering for discussion, but if we want work to be assigned, it either has to be via a bug report (which this is not), or by feature requests at feedback.

Did you try the display.setDefault() option I suggested above?

Rob

Thanks Rob. Will try setDefault in main and will and report back once we’ve got the new build ready.

I just wonder if there is room for another line of communication to the engineers. Something like this isn’t really a “feature” it’s more of a suggestion for a better way of dealing with something you can already do ie change the bg color. Maybe there should be a suggestion forum where users can suggest simple operational tweaks to engineers. Using a vote system would be disingenuous when dealing with bugs but also when dealing with minor operational matters.

Anyway report back soon.

Feature and Suggestion are the same.

Rob

You will need to put in a feature request for this at http://feedback.coronalabs.com

Rob

Really? Wouldn’t call this a “feature”, more of a process.

Ya i think this can be done without a “Feature” Maybe @Rob misunderstood. Can you explain it a bit more as i don’t understand fully either.

Thanks!

–SonicX278

@sonicX278, thanks for taking a look. We need to have a white background instead of a black behind the default.png launch image before main.lua runs. IOS handles this with its selection of launch images based on screen aspect ratios. That’s not possible with the multitude of screen aspect ratios on Android devices. So defining background color at launch is required if you want to avoid the black background default.

On Android, we load a file called Default.png (no 2x, landscape, or any other versions) at the beginning of the Main activity. This is before main.lua runs. There is a gap of time between then where you get a black screen before your first frame update. Depending on how much stuff you do in  your main.lua, the time before that first frame update may be longer than you think.

You might be able to mitgate this by using display.setDefault( “background”, 1, 1, 1 )

see: https://docs.coronalabs.com/api/library/display/setDefault.html#color-keys

But it’s possible that might not even kick in until the first frame update, which is why I suggested a feature request. It might be possible to change how we address the Default.png to help get rid of that gap.

Another possibility, and this is Truly the Android way is to not use the Default.png at all. Use the excludeFiles section of your build.settings and don’t include it in your Android build. You will have a longer gray startup, but this is normal for Android apps as they don’t use Default.png’s anyway. This was something we did to make it more in-line with the iOS side due to developer demand. If you still want a splash screen load it as the first thing in main.lua. If you use display.newImageRect() you get to use @2x and @4x images if you have them. You can then load the rest of the things you do in main.lua and then remove the splash screen before you start showing your real screen.

Apple doesn’t like splash screens. They want the Default.png file to mimic the first screen the viewer sees to give the illusion the app is starting faster. While that’s Apple’s opinion, it make sense from an Android perspective too.

Rob

Thanks Rob. The best solution would be to allow the background color to be set in config or build. I could apply in feature request but that would be stretching the idea of a “feature”. When we are creating our framework we are always open to any way it can be easily tweaked to function more effectively. Is there another forum where ideas like these can be communicated to engineers?

We use http://feedback.coronalabs.com to track things users want to see added or changed about the framework. We use the number of votes as one metric in deciding where we spend engineering resources. These forums are great to talk about it. I can take things to engineering for discussion, but if we want work to be assigned, it either has to be via a bug report (which this is not), or by feature requests at feedback.

Did you try the display.setDefault() option I suggested above?

Rob

Thanks Rob. Will try setDefault in main and will and report back once we’ve got the new build ready.

I just wonder if there is room for another line of communication to the engineers. Something like this isn’t really a “feature” it’s more of a suggestion for a better way of dealing with something you can already do ie change the bg color. Maybe there should be a suggestion forum where users can suggest simple operational tweaks to engineers. Using a vote system would be disingenuous when dealing with bugs but also when dealing with minor operational matters.

Anyway report back soon.

Feature and Suggestion are the same.

Rob