r/learnandroid • u/[deleted] • Jan 13 '14
Multithreading for a dummy
Hello /r/learnandroid! I am currently working on a game for the android market but I'm having a problem with loading things. My logcat (I'm using Eclipse) says that I'm skipping frames at certain points. I understand where these points are and I understand some of the basics of multi-threading, but I don't understand where I can put the second thread to make the application run smoother.
Any help would be greatly appreciated!!
0
Upvotes
1
Jan 13 '14
If you are targeting android only and not using any libraries (although I'd recommend using one, such as Libgdx), I'd suggest reading about asynctasks since are a level of abstraction higher from threads.
2
u/SimonGray Jan 15 '14
Consider starting out by putting all the game logic stuff in a separate thread and then calling the UI thread from that thread when you need to paint the screen. The frame skipping comes from you doing som intense calculations on the main thread.