|
- LogHelper.dfile("czy","经纬度 lat = "+lat+"lon="+lon+" 位置 ="+loc.getAddress());
|
|
202
|
+ LogHelper.d(TAG,"上报经纬度 lat = "+lat+"lon="+lon+" 位置 ="+loc.getAddress());
|
206
|
203
|
reportLocationWhenTourMode(lat,lon);
|
207
|
204
|
}
|
208
|
205
|
};
|
|
|
@@ -211,9 +208,11 @@ public class MyLocationService extends Service implements Handler.Callback{
|
211
|
208
|
private void startLocation(){
|
212
|
209
|
initLocation();
|
213
|
210
|
if(Preferences.getInstance(this).isTourMode()){
|
|
211
|
+ LogHelper.d(TAG,"当前是旅行模式,开始定位");
|
214
|
212
|
locationClient.setLocationOption(locationOption);
|
215
|
213
|
locationClient.startLocation();
|
216
|
214
|
if(Preferences.getInstance(this).getGatherTime()> System.currentTimeMillis()){
|
|
215
|
+ LogHelper.d(TAG,"当前是旅行模式,且存在集合时间,预约下一次定位");
|
217
|
216
|
mHandler.sendEmptyMessageDelayed(MSG_START_LOCATION,Preferences.getInstance(this)
|
218
|
217
|
.getGatherTime()-System.currentTimeMillis()>LOCATION_PERIOD_CHANGE_DEADLINE ? LOCATION_MAX_PERIOD:LOCATION_MIN_PERIOD);
|
219
|
218
|
}
|
|
|
@@ -235,7 +234,7 @@ private void reportLocationWhenTourMode(double lat, double lon){
|
235
|
234
|
if(locationClient!=null){
|
236
|
235
|
locationClient.stopLocation();
|
237
|
236
|
}
|
238
|
|
- if(lat == lastLat && lon ==lastLon && repeatTime<5){
|
|
237
|
+ if(lat == lastLat && lon ==lastLon && repeatTime<2){
|
239
|
238
|
repeatTime++;
|
240
|
239
|
return;
|
241
|
240
|
}
|
|
|
@@ -4,7 +4,7 @@ buildscript {
|
4
|
4
|
jcenter()
|
5
|
5
|
}
|
6
|
6
|
dependencies {
|
7
|
|
- classpath 'com.android.tools.build:gradle:2.3.0'
|
|
7
|
+ classpath 'com.android.tools.build:gradle:2.3.1'
|
8
|
8
|
|
9
|
9
|
// NOTE: Do not place your application dependencies here; they belong
|
10
|
10
|
// in the individual module build.gradle files
|