これでタワーIDとgpsを使用してgpsの場所を取得しています.現在の場所を取得してトーストに表示できます.5分ごとに自動的に表示する必要があります. 私のコードは
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();
}
}