i am working in get gps location using tower id and gps in this i can get the current location and displaying it in toast i have to dislpay it automatically for every five minutes and also to display it in maps on android device can anybody help me. my code is
public void onClick(View arg0) {
// create class object
gps = new GPSTracker(AndroidGPSTrackingActivity.this);
// check if GPS enabled
if(gps.canGetLocation()){
double latitude = gps.getLatitude();
double longitude = gps.getLongitude();
// \n is for new line
Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show();
}else{
Toast.makeText(getApplicationContext(),"cant get location", 1000 ).show();
// GPS or Network is not enabled
// Ask user to enable GPS/network in settings
gps.showSettingsAlert();
}
}