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 there.
The work to do is:
- Allow the user to enter a country name and displays the three most popular artists in that country as well as their songs. At this point, it’s interesting to understand the difference between normal and AJAX form submission.
- Add a browser independent way to check whether the HTML5 Geolocation API is available (using Modernizr)
- Obtain the current coordinates using the HTML5 API
- 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 Manual Geolocation Plugin 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.