Is it safe to load resources during OnUpdate?

Monkey Targets Forums/Android/Is it safe to load resources during OnUpdate?

matty(Posted 2011) [#1]
Hello all again.

I'm curious to know whether it is safe to load resources in Android apps during the OnUpdate method of a monkey application.

Or should all loading of resources (images/sounds) be done only in the OnCreate method?


Xaron(Posted 2011) [#2]
I load only the splash screen during OnCreate, display it immediately in OnRender and load the remaining stuff in OnUpdate. Works great.


MikeHart(Posted 2011) [#3]
As soon as your app crashes because it takes to long to load the resources, then you know you will HAVE to load your stuff inside the OnUpdate event.


AdamRedwoods(Posted 2011) [#4]
Don't you have to do a check if you've already loaded your resources so you don't load them repetitively?


Rixarn(Posted 2011) [#5]
Yes Adam, and for that you could do a ResourceManager class :)


MikeHart(Posted 2011) [#6]
Or very simple, use a finite state machine approach.


Shinkiro1(Posted 2011) [#7]
I've uploaded a RessourceManager in the CodeArchives.