| Thoughts on How To Implement Splash Screen on Android? |
| Thoughts on How To Implement Splash Screen on Android? |
|
R Manard
Guest
|
Lazy foo , Google his examples and you'll see a great splash screen On Feb 23, 2014 4:09 PM, "jlev31415" wrote:
|
|||||||||||||
|
|
||||||||||||||
| Thoughts on How To Implement Splash Screen on Android? |
|
Jonny D
|
How long is your test device taking to finish initializing SDL and getting the window set up? My apps don't have much of a delay at all before they can show something.
Jonny D |
|||||||||||
|
|
||||||||||||
|
jlev31415
|
@R Maynard: I could not find any Lazy Too tutorials/examples regarding Android-based splash screens. All his stuff appears to be general, basic SDL tutorials. If you could provide a link to the page with which you are referring, it would be appreciated.
@Jonny D: Running a Galaxy S4, which is no slouch, my app takes between 1-2 seconds before it starts drawing. I'm fairly sure I could cut some more time off with a little optimization, and some of the delay may be due to running a debug build, however, I'm concerned that even if I make it tolerable on this device, the discrepancy in hardware out in the field could exemplify the delay on other devices. Out of curiosity, what device are you running, and what kind of delay are you seeing? Are you running a release build? If so, have you noticed a significant improvement vs. a debug build? |
|||||||||||
|
|
||||||||||||
| Thoughts on How To Implement Splash Screen on Android? |
|
Alvin Beach
Guest
|
On Sun, Feb 23, 2014 at 6:09 PM, jlev31415 wrote:
What I have done was to initialise as very little as possible, then displayed a static image. Then I continued my initialisation. The static image (the splash) then gets replaced once my main loop kicks in. For example, my initialisation looks something like this: SDL_Init SDL_CreateWindow SDL_CreateRenderer Mix_Init Mix_OpenAudio TTF_Init IMG_Load(/super_awesome_splash_image.png/) SDL_SetRenderColor(/white/) SDL_RenderClear SDL_RenderCopy(/texture of the splash image/) SDL_RenderPresent /clean up/ Admitantly, a more barebones initialisation would not include SDL2_mixer and SDL2_ttf initialisation. On the limited number devices I have tested (Galaxy Tab 10.1, Galaxy Tab 2 7.0, emulator) I don't see much of the splash screen. SDL2 seems to load fairly fast. In fact, I had to introduce a 1s delay after calling SDL_RenderPresent just so I could see it. Hope this helps. Alvin _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
| Thoughts on How To Implement Splash Screen on Android? |
|
Jonny D
|
On my Samsung Vibrant (Galaxy S) running CyanogenMod, it takes roughly 1.5 seconds from when I touch the icon to when my loading screen appears. About 0.5 seconds is taken up by the launcher's own animation (a black box growing to the screen size). There's no noticeable difference between my debug and release builds.
Jonny D |
|||||||||||
|
|
||||||||||||
| Thoughts on How To Implement Splash Screen on Android? |
|
R Manard
Guest
|
The examples that lazy foo has are cross platform in their sdl. I was saying you could use his splash screen method in one thread and loading the other.
|
|||||||||||
|
|
||||||||||||
| Thoughts on How To Implement Splash Screen on Android? |
|
slvn
|
Hello,
I do a static splash screen, on android, in a very convenient way : In the file "AndroidManifest.xml", I use the theme "splashScreenTheme" : <application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:allowBackup="true" android:theme="@style/splashScreenTheme" android:hardwareAccelerated="true" Which is defined in "res/values/style.xml" : <resources> <style name="splashScreenTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> <item name="android:windowBackground">@drawable/splash_shelf</item> </style> </resources> It uses a drawable "res/drawable/splash_shelf.xml" : <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/splash_screen" android:filter="true" /> Which is, in fact, a splash screen image file "res/drawable/splash_screen.png". Hope it helps, Cheers, Sylvain On Mon, Feb 24, 2014 at 8:28 PM, R Manard wrote:
-- Sylvain Becker _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
|
jlev31415
|
@Sylvain: Thank you for the detailed reply! This is exactly along the lines of what I am attempting to do. Unfortunately, though, I tried setting things up as you described, and I am having the same issue I had with my previously mentioned attempt. The splash screen is only shown for a brief flash (actually it's almost impossible to see because it's gone before the app has grown to full-screen size), because when SDLActivity launches, it immediately creates a new layout, overriding the layout containing the splash screen, which causes the screen to go black again until everything is initialized and I'm able to draw. Is there anything special you're doing in your app initialization in order to keep the splash screen up longer?
@Jonny D: Thanks for the info. I'm also running Cyanogenmod (CM11). It seems like we both have similar timings. It seems to vary quite a bit for me - does it for you? I assume it's just due to whatever background process happens to be running at the time. @Alvin Beach: Thanks. I thought doing whatever I could to optimize my initialization and get something up on the screen ASAP, but I was hoping to avoid this and use the tools already available with the Android platform in order to have an Android-only splash screen that doesn't need to be crammed into my cross-platform code if I can help it. |
|||||||||||
|
|
||||||||||||

