Proper procedure to poll GPS location for enhanced GeofencingApi on Android Studio
<p>I’m no programmer but even so I just endeavoured into ‘mixing’ (from others' samples and instructions) a small android project for an art installation that is to be presented outdoors throughout a local university campus. This app, that will display pop-up windows containing anecdotal narrations of events that occurred at that spot upon crossing it’s respective radial fence within the field , requieres location acquisition that doesn’t rely on data carriers or wi-fi providers since there is no coverage in the area and besides those seem to be quite unstable even when tested in an urban environment with network and wi-fi signals available.</p>

<p>I’m using the official example that comes with the android developer documentation, however I’ve read that due to an over efficient practice, the developers biased the API towards using only cellular data and wi-fi unless GPS_PROVIDER is called into polling it’s output thru locationManager so that once requested by the app, the geofence instance can retrieve the more precise location chiefly from there. But I am stuck as to in which portion of the code to add this pertaining lines whether it be a separate class within the java folder or inside the Mainactivity itself as well as to where else in the structure (aside the manifest in the form of permissions) do i have to reference their existence for it to work coherently.</p>

<p>Any help is welcomed.</p>