Although you have edited your question still not clear to me what exactly is your concern.
I'll give you some background information about concurrency, and let's see if it helps...
What is it
First, concurrency means a software designed to have more then one thread. That doesn't means that more then one thread will run in simultaneous, which only happens if you have a device with more then one core. If the device only has one core, only one thread will run at a time, and the system will switch between them.
As soon as your system is designed to have more then one thread, you must ensure that all your code (and used libraries) that are dealing with shared objects are thread safe.
Why should I need it
The most common reansons why you would need to use threads are:
- You have a heavy piece of code that could be split into parts, and you have a device with more then one core. In this case, you could have a performance benefict from having two (or more) simoultaneous running threads dealing with parts of the work.
- You have a blocking operation in your code (i.e. read from a socket). This should be moved to a separate thread to avoid blocking all your program until socket.read() returns.
- Finally and the most commun one in Android, any long run operation (i.e. more then a couple of seconds) should be moved to a different thread from he one used by the UI (user interface), to avoid pour user experience and/or the ANR error.
Your situation
You refer that you are using LocationManager
and an Handler
. None of these classes imply using a different thread.
LocationManager
uses the callback onLocationChange()
to run the code you define in the UI thread.
Handler
runs the code in the thread where the handler is assigned to. So if you created your handler in the UI thread, the handler callback will be run there as well.
Only if you create a new Thread
(or any other class that does the same) you have a real multi-thread app that requires you to be carefull with shared objects.
Hope it helps. Let me know if you need more clarification.
Regards.