Commit aa4d5f7c by cuiliang.shi

15次 取最佳精度

1 parent 7f8c53bf
......@@ -114,6 +114,7 @@ public class BirdService extends Service {
};
private int mLocationCount = 0;
private float mAccuracy = 10000;
public AMapLocationListener mLocationListener = new AMapLocationListener() {
@Override
......@@ -127,12 +128,19 @@ public class BirdService extends Service {
+ ", amapLocation.getAccuracy():"+amapLocation.getAccuracy()
+"amapLocation.getLocationType()" + amapLocation.getLocationType());
if (mLocationCount > 4){
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
mStartTime = dateformat.format(System.currentTimeMillis());
if (amapLocation.getAccuracy() < mAccuracy){
mAccuracy = amapLocation.getAccuracy();
mLatitude = String.valueOf(amapLocation.getLatitude());
mLongitude = String.valueOf(amapLocation.getLongitude());
}
if (mLocationCount > 15){
Log.d(TAG, "LAST PERFECT INFO amapLocation.getLatitude(): " + mLatitude
+ ", amapLocation.getLongitude(): " + mLongitude
+ ", amapLocation.getAccuracy():" + mAccuracy);
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
mStartTime = dateformat.format(System.currentTimeMillis());
if (mLocationClient != null) {
mLocationClient.stopLocation();
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!