Android - NetworkOnMainThreadException using SpiderMonkey

So should i use AsyncTask when i create the client?

EDIT: I have an issue implementing this.

I have to create an AsyncTask on my SimpleApplication class,but how can i? Is there a way to import android’s api to the game project too?