I have the following task:
I have to do a Wi-Fi scan
and then send some RSSs
to the a server to obtain a location from the server. After that I should display the location on a map.
I have one activity
in my application. What is the best way to implement it? I haven't implemented a thread nor AsyncTask
in android before. So I don't know a lot about it. I have read about threads and AsyncTask on android developer website. But I still can't understand everything.
I would appreciate it if anyone can tell me when its the best to use threads, and how AsynTask is different from threads and when to use AsyncTask instead of threads
.
EDIT: the task that I have to implement should run only when the user click on actioBar item
.