title: Simple code to get GPS coordinates in android marshmallow
body: <p>i am developing an android app that targets marshmallow. i did enough searching but could not get a simple code to get GPS coordinates. i wanted a code that could give me GPS coordinates over some intervals. like for eg. every 10 mins i need to check the coordinates if person is in a specific area for duration of 30 mins. so app will check coordinates for every 10 mins that 3 times. Please help. :(</p>
  
  <p>Note: i know about the gpstracker.java example available but it doesn't works for marshmallow.
  I want the GPS coordinates in form of longitude and latitude.
  Help with link is also appreciated.</p>