Hey all,
I am writing a cross-plattform multiplayer game with libGDX. How do I implement network code which require AsyncTask on Android?
Thanks in advance!
Hey all,
I am writing a cross-plattform multiplayer game with libGDX. How do I implement network code which require AsyncTask on Android?
Thanks in advance!
Can you be more specific, give an example
I want to develop a game that is runnable as desktop client as well as mobile Android client. Now I want to connect to an XMPP server. For the desktop client you can establish the connection from the main thread, for Android you have to use AsyncTask. My question was how to get a solution for the libGDX framework that works for both, desktop and client.
Libgdx has a class called AsyncExecutor
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/async/AsyncExecutor.html
Is this what you need
I have also found this class, but I don’t understand what the exact purpose is and if it is suitable at all. I haven’t found any examples or documentation… :-\
What about the AssetManager
https://code.google.com/p/libgdx/wiki/AssetManager
it does asynchronous loading
Read the Writing your own Loaders section
With LibGDX one of the best ways to find examples is to look at the tests. They have quite a few tests and show how to use different features and such.