Obtaining the current GPS location
Very often, smartphones are equipped with GPS receivers that allow you to get the current GPS coordinates. Of course, you can use such a sensor while developing applications. Due to the availability of a built-in mechanism, obtaining coordinates is really easy, as you will see in this recipe.
As an example, you will create a page with the map presenting an outline of Poland. The current location of the user will be shown on such a map as a black circle. What is more, the circle indicating the current status of the mechanism of obtaining the GPS coordinates will be presented on the page.
Getting ready
To step through this recipe, you only need the automatically generated project.
How to do it...
To prepare an example that presents the current location of the user on the map, perform the following steps:
- Add the
Map.png
file to theAssets
directory. The file is available together with the code attached to this chapter. - Enable the Location capability by double-clicking...