Page 1 of 1
How to replace black screen when launching app w/ image
Posted: Wed Jun 03, 2015 3:10 pm
by sms5138
Hi everyone!
I've been testing my app on the iphone, and android for a few days now, and wondered if anyone has any suggestions one how show an image or loading bar or really anything when launching the app. The app connects to a database on openstack, and a few things on preopenstack. This can take in some cases 8 to 10 seconds. while it's doing this there is nothing visible on the screen. its just black. is there a way to show an image or anything while it's running through these steps?
Thanks in advance for any advice you may have!
-Sean
Re: How to replace black screen when launching app w/ image
Posted: Wed Jun 03, 2015 3:24 pm
by atout66
Just an idea...
Couldn't you create a card in the main stack which would be the first card where you would show a Welcome message and just after, send the initAll handler you require with a "Please wait while loading..." text ?
You could replace that text by an image I guess...
Regards, Jean-Paul.
Re: How to replace black screen when launching app w/ image
Posted: Wed Jun 03, 2015 4:18 pm
by sms5138
I'll have to give that a try, and report back.
This thought may be spot on or completely off, but i notice that in the standalone build setting there's an option to upload a "splash screen". Does anyone have experience or knowledge of how a splash screen works or what it's purpose is?
Re: How to replace black screen when launching app w/ image
Posted: Wed Jun 03, 2015 7:28 pm
by jacque
The splash screen on iOS is intended to get around exactly the problem you're having. It is displayed before your app even begins to load, and gives the user something to look at while all the heavy work is happening. You don't have any control over it, it's just an image and the OS handles the display, so you can't put a progress bar there or anything like that. Apple has guidelines about it, it should look like the first card of your stack but without any data; they give the example of the contacts app which shows the layout without any actual contact data. The data shows up soon after the "empty" form appears.
Android has a place for a splash screen too but I've never used it. I've seen comments here though that it doesn't always work. I'd try it and see. If it doesn't do what you want you should rewrite your app a little bit.
Changing the order of how your app gets its data will solve the problem on both iOS and Android, and is pretty simple. Don't load any data until after the app starts up. The user will see the first card almost immediately, and you have full control over what happens. Instead of getting the data on preOpenStack or preOpenCard, put a command in the openCard handler on the first card that calls the data retrieval using the "in <time>" structure:
Code: Select all
on openCard
send "getData" to me in 1 millisecond -- adjust if that's too soon
end openCard
on getData
-- retrieval here
end getData
Another advantage with this method is that you can put up a "loading" message or a progress bar, or some other way of letting the user know that the app is busy.
Re: How to replace black screen when launching app w/ image
Posted: Wed Jun 03, 2015 8:27 pm
by sms5138
Thanks jacque,
I appreciate your help. I'll follow up later after I've had a chance to try it out.
-Sean