Page 1 of 1
How to Improve App Launch Time
Posted: Mon Oct 17, 2011 9:24 pm
by Tester2
On my iPhone 4, when my iOS app launches for the first time after a reboot, it takes about 14 seconds on the Launch Screen until it reaches the main home screen.
Reopening the app after the first initial launch will take about 4 seconds for this process to occur (much better!).
Is there a way to speed up this first launch process so it doesn't take 14 seconds?
This is all I have in my stack script:
on resizeStack pNewWidth, pNewHeigh
put pNewWidth & pNewHeigh
into tResize
-- Resize/Move card controls here when stack is resized
switch tResize
case "320480" -- iPhone Vertical
break
case "640960" -- Retina Vertical
break
default
end switch
end resizeStack
Re: How to Improve App Launch Time
Posted: Mon Oct 17, 2011 10:04 pm
by Klaus
What is in the script of the first card?

Re: How to Improve App Launch Time
Posted: Mon Oct 17, 2011 10:06 pm
by Tester2
Thanks so much for responding!
My bad...totally forgot to add that:
on openStack -- it's still invisible
if the environment is "mobile"
then
if item 1 of iphoneDeviceResolution() = "320" then go to stack "iPhone 3G"
else
go to stack "iPhone 4"
end if
go to card "Home"
end if
end openStack
Re: How to Improve App Launch Time
Posted: Tue Oct 18, 2011 12:01 pm
by Klaus
Hi Tester2,
hm, does not look very spectacular!?
In what stack is card "Home"?
If it is in the stack that you are going to, you could try:
Code: Select all
...
if...
go cd "Home" of stack "iPhone 3"
else
go cd "Home" of stack "iPhone 4"
end if
...
and see if that helps.
Sorry, no idea so far!
Best
Klaus
Re: How to Improve App Launch Time
Posted: Tue Oct 18, 2011 9:07 pm
by Tester2
Hey Klaus,
Yes. The Home card is in each of the stacks I am navigating to. I tried adding the code you gave me, but it didn't save much more than a few tenths of a second.
I don't know of any other way to make it faster, besides chopping out one of my stacks so it doesn't have to switch between them.
Are there any processes that run on startup, kind of in the background, that can be removed or modified - that might be taking time?
Thanks.
-Tester2
Re: How to Improve App Launch Time
Posted: Wed Oct 19, 2011 1:51 pm
by BvG
If you have a lot of objects on the first card of a stack, that can take away time to calculate the rendering, experimenting with making them invisible or grouping the objects can help with that. Don't show a browser or a movie on startup either.
Re: How to Improve App Launch Time
Posted: Thu Oct 20, 2011 12:19 am
by Tester2
Thanks BvG..I will try that.
Do you know, does LiveCode only render/load one card at a time, or all of them at startup?
Thanks bunches!
-Tester2
Re: How to Improve App Launch Time
Posted: Fri Oct 21, 2011 11:34 am
by SparkOut
Do you keep any data (especially binary data, or code) in a (possibly hidden) field?
If so, even though it is hidden, there will be a lot of overhead on the "invisible" rendering in the field.
It is much more efficient not to use fields for hidden data, and put such things into custom properties.
Just in case that helps.
Re: How to Improve App Launch Time
Posted: Thu Oct 27, 2011 6:24 pm
by jacque
This is a shot in the dark, but "home" is a reserved word in LiveCode. Even though you are referencing it correctly and it shouldn't cause any problems, the engine may be misinterpreting that name. What happens if you rename those cards to something else?