开发者

What exactly is a *loading screen* loading in Android?

Just looking for some advice on this one, what exactly is a loading screen loading? The only thing I can think of is images and objects (classes) but that is all done in my constructor and, even on slower phones, finished pretty much instantaneously.

There can be a sharp fall in the Frames Per Second (FPS) when the screen is initially loaded (all images are on screen) but after a second or so the FPS is back up at 60 (so it takes a few seconds to load something). Looking at the Logcat, there are a couple things from the "Adapter" class that are in the process of loading, so I'm thinking that may cause the initial drop in FPS but how to I preload this?

开发者_StackOverflow中文版

I am making an Android game.

Hope this question makes sense, and thanks in advance!

LogCat Example

08-23 17:19:24.769: WARN/Addapter(1460): info.icon:2130837504
08-23 17:19:24.769: WARN/Addapter(1460): info.icon:2130837527
08-23 17:19:24.769: WARN/Addapter(1460): info.icon:2130837508
08-23 17:19:24.769: WARN/Addapter(1460): info.icon:2130837564
08-23 17:19:24.769: WARN/Addapter(1460): info.icon:2130837564
08-23 17:19:24.779: WARN/Addapter(1460): info.icon:2130837513


Not exactly sure what you're asking but I'll give it a go.

A loading screen basically just 'loads'. It can load whatever you want like images, a tilemap for your game, music, shaders, meshes, configuration, etc. You obviously don't want to have things loading during the game. You don't always need an actual loading screen, especially if your game doesn't have that many assets. You can just load them from the UI thread and it won't matter that everything freezes up since its not going to take that long and no one should be doing anything during loading anyways.

As for the sharp fall in FPS, that could just be the garbage collector cleaning up some forgotten objects during the loading process. Look at logcat to see if you see something like "GC_CONCURRENT" during the freezes. Thats the gc(garbage collector). Theres really not much you can do about it other than paying close attention to your allocations and keeping track of all your references

But looking at your logs now, I have to ask what is "Addapter"? Did you copy&paste those logs or did you write them manually and accidentally add an extra d? If you're using a third party library or something it would be useful to post that information since they could have their own that cause a 'sharp' drop in fps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜