This topic is part of our Mobile Application Development with HTML5 training
Mobile devices generally have various sensors like the camera, a GPS, a compass and an accelerometer. It is instructive to see how one can use the standard HTML5 API to, for example, know where the device is located. This then opens all sorts of possibilities like for example, displaying the songs which are the most popular where the user is.
The work to do is:
- Obtain the current coordinates using the HTML5 API. In Cordova, it is important to add the Geolocation plugin to the app.
- Use the Google Maps API to do reverse geocoding (i.e. determine country name given location). It is important to get a Google API key before attempting to use the Google APIs. If you are using Google Chrome, you may find the device sensors emulation feature useful.
- Display the artists and songs of the country we are located (if possible)
- Add a Google Map to the application to show where the user is.
This topic is part of our Mobile Application Development with HTML5 training
Leave a Reply