Add A Splash Screen With The Android Manifest For Delphi XE5 Firemonkey Apps

I found another way to do a splash screen with Delphi XE5 Firemonkey apps on Android over at a Korean Delphi blog by Humphrey. Kim Hyun – Soo. Basically this method is much easier than modifying the classes.dex file and much better than just implementing the splash screen on your Delphi form. The idea of the splash screen is to have something for the user to look at instead of a black screen while the rest of the app is loading. The general implementation is that you create a styles.xml file which sets up a background image as a style and then you assign that to the theme part of the Android manifest. You must include the styles.xml file and the splash screen image in your project when deploying, make the small change to the Android manifest, and that is all there is to it. The change to the Android manifest looks like this:

This method is here working fine too, thanks to the available source code example. But this is technic has some drawback(s) and One of them it is stretching and squeezing the Image to fit the scrreen, circles become eegs, nothing what can be appreciated – let say for a real company logo.
So i did some digging and we are sadly not alone with this approch, but i found only a particul solution for my problem, which is “The image sould keeping its aspect ratio, while fitting the screen”.
The particular solution it found is answer here http://stackoverflow.com/questions/12607756/show-splash-screen-image-with-auto-fit

So on the small scrren, you will only see the center of the image. Maybe someone has found a even better solution, please post it here or somewhere else, but i hope(a lie) Embarcadero will come up with a real answer – say it wih a more RAD approach.

I “played” a little bit further with this topic and ask myself how is it possible to support multiple screen size, resolution, oriantion, density, format 4:3, 16:9, etc. pp. – using only xml config files. After some google digging i found out how the Android OS support such functionality. You simply must provide copies of the same image(filename) with alternative resolutions and put these files each into specified paths, depending on the App supported Android API Level, which is described fully here http://developer.android.com/guide/practices/screens_support.html .
I did same basic tests and i was able to show different Splash Screen images depending on the actual screen size of two tablets 7 and 10 inches. I noted if the provied image is smaller as the physical screen of the device the “empty parts” are drawn black. A solution for this problem might be an NinePatch http://developer.android.com/tools/help/draw9patch.html .

Got this working, but it does not seem to solve the black screen problem. It now shows the splash immedaitely, then the black screen
shows afterwards and the user still has to wait with a black screen till the app starts. I have a datasnap app which
is slow to start. Maybe I have missed something.

What happens if you add the splash screen to an empty app? Do you still get the black screen between the splash and the app becoming visible? If no, then my recommendation is to move your setup out of OnCreate and OnShow if possible (like with a 1-3 second timer). And do some kind of lazy form creation: http://blogs.embarcadero.com/pawelglowacki/2014/02/19/40191/