Getting Coordinates - Smarter Ways

Getting Coordinates - Smarter Ways

Let’s get our current coordinates in smarter ways. If you haven’t already gone through the previous part, I insist that you read it. It explains the basics of acquiring a location. Here we will build over what we learnt previously and get ourselves smarter.

Coordinate Alert using Thread

Run a new project using It uses a separate thread to access the location info. So the UI remains active with the main thread taking care of it. Now you can exit even when the program is busy fetching the location info. Since threading is a general concept in Java, I am not going to elaborate on that. But remember the following points –


Why shout every time when the other guy is ready to shout and you just need to listen? Run another project using Note that now the device asks for location acquiring permission only once.

How Location Listener works?

Points to note about Location Listener

Other issues

Now that we have found our position, let’s try to find out the landmarks. What good is the location info if we can’t get to our desired point of interest?