diff options
Diffstat (limited to 'client/Piztor/src/com')
-rw-r--r-- | client/Piztor/src/com/macaroon/piztor/Main.java | 7 | ||||
-rw-r--r-- | client/Piztor/src/com/macaroon/piztor/Transam.java | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/client/Piztor/src/com/macaroon/piztor/Main.java b/client/Piztor/src/com/macaroon/piztor/Main.java index 97d2f7b..5951db1 100644 --- a/client/Piztor/src/com/macaroon/piztor/Main.java +++ b/client/Piztor/src/com/macaroon/piztor/Main.java @@ -55,7 +55,7 @@ public class Main extends PiztorAct { public MyLocationListener myListener = new MyLocationListener(); boolean isFirstLocation = true; public static int GPSrefreshrate = 20; - private final int checkinRadius = 10; + private final double checkinRadius = 10.0; ImageButton btnCheckin, btnFetch, btnFocus, btnSettings; @@ -334,11 +334,11 @@ public class Main extends PiztorAct { (int) (locData.longitude * 1E6)); double disFromMarker = DistanceUtil.getDistance(curPoint, mapMaker.getMakerLocation()); - if (disFromMarker < locData.accuracy) { + if (disFromMarker < Math.max(Math.min(locData.accuracy, 20.0), (float)checkinRadius) ) { alertMaker.showCheckinAlter(); } else { Toast toast = Toast.makeText(Main.this, - "请靠近路标", 2000); + String.format("请靠近路标,现在距离%.2f米", disFromMarker), 2000); toast.setGravity(Gravity.TOP, 0, 80); toast.show(); } @@ -376,6 +376,7 @@ public class Main extends PiztorAct { mLocClient.registerLocationListener(myListener); LocationClientOption option = new LocationClientOption(); option.setOpenGps(true); + option.setPriority(LocationClientOption.GpsFirst); option.setCoorType("bd09ll"); option.setScanSpan(GPSrefreshrate * 1000); mLocClient.setLocOption(option); diff --git a/client/Piztor/src/com/macaroon/piztor/Transam.java b/client/Piztor/src/com/macaroon/piztor/Transam.java index 6660899..df2194f 100644 --- a/client/Piztor/src/com/macaroon/piztor/Transam.java +++ b/client/Piztor/src/com/macaroon/piztor/Transam.java @@ -55,10 +55,10 @@ public class Transam implements Runnable { Timer pushtimer;
boolean running = false;
boolean pushing = false;
- int cnt = 5; //retry times
+ int cnt = 3; //retry times
int tcnt; //current remain retry times
int rcnt; //current remain retry times (push)
- int retime = 5000; //timeout time
+ int retime = 10000; //timeout time
Req req;
int p; //port
String i; //ip
|