To ask user to enable GPS, check out this link
Below would be the innards of a function that attempts to get the last known GPS location in descending accuracy order. If the user does not have GPS enabled, you cannot enable it. The best you can do is grab the last known location, or prompt them to enable GPS. Everytime the user uses GPS in another app and obtains a new coordinate, or connects to a wireless network the last known location will change. I suppose you could write a background service that polls this data every 5-10 minutes and sends it to you. Although, I don't agree with the direction you seem to be heading with this application. lol. For Science!
LocationManager lm = (LocationManager)act.getSystemService(Context.LOCATION_SERVICE);
Criteria crit = new Criteria();
crit.setAccuracy(Criteria.ACCURACY_FINE); String provider = lm.getBestProvider(crit, true);
Location loc = lm.getLastKnownLocation(provider);
if(loc){
return loc;
}
lm = (LocationManager)act.getSystemService(Context.LOCATION_SERVICE);
crit = new Criteria();
crit.setAccuracy(Criteria.ACCURACY_COARSE);
provider = lm.getBestProvider(crit, true);
loc = lm.getLastKnownLocation(provider);
if(loc){
return loc;
}
lm = (LocationManager)act.getSystemService(Context.LOCATION_SERVICE);
crit = new Criteria();
crit.setAccuracy(Criteria.NO_REQUIREMENT);
provider = lm.getBestProvider(crit, true);
loc = lm.getLastKnownLocation(provider);
return null;