Skip to content

Commit 9a6a985

Browse files
author
wenlong
committed
更新百度定位SDK
1 parent d8c9944 commit 9a6a985

File tree

11 files changed

+26
-19
lines changed

11 files changed

+26
-19
lines changed

libs/BaiduLBS_Android.jar

231 KB
Binary file not shown.
0 Bytes
Binary file not shown.

libs/armeabi/liblocSDK4d.so

-33.8 KB
Binary file not shown.

libs/armeabi/liblocSDK5.so

33.8 KB
Binary file not shown.

libs/comobd-3G-SDK-1.0.0.jar

-30.6 KB
Binary file not shown.

libs/libcomobd-3G-SDK-1.0.0.jar

15.8 KB
Binary file not shown.

libs/locSDK_4.2.jar

-195 KB
Binary file not shown.

src/com/obd/app/bean/DROInfo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,23 @@ public void setMAF(String arg){
7575
public int getMILESM(){
7676
int ret = 0;
7777
try {
78-
float f = Float.parseFloat(MILES);
78+
float f = Float.parseFloat(MILE_T);
7979
ret = (int) (f*1000);
8080
} catch (Exception e) {
8181
// TODO: handle exception
82-
MyLog.W("累计里程km转换成M失败 MILES="+MILES);
82+
MyLog.W("累计里程km转换成M失败 MILE_T="+MILE_T);
8383
}
8484
return ret;
8585
}
8686

8787
public int getFuleSmL(){
8888
int ret = 0;
8989
try {
90-
float f = Float.parseFloat(FUELS);
90+
float f = Float.parseFloat(FUEL_T);
9191
ret = (int) (f*1000);
9292
} catch (Exception e) {
9393
// TODO: handle exception
94-
MyLog.W("累计油耗L转换成mL失败 FUELS="+FUELS);
94+
MyLog.W("累计油耗L转换成mL失败 FUEL_T="+FUEL_T);
9595
}
9696
return ret;
9797
}

src/com/obd/service/DataSyncService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void onCreate() {
6868

6969
private void initSingle(){
7070
MyPhoneStateListener MyListener = new MyPhoneStateListener();
71-
TelephonyManager tel = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE);
71+
TelephonyManager tel = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE);
7272
tel.listen(MyListener ,PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
7373

7474
mGetLoaction.uploadBattery(0);
@@ -196,8 +196,10 @@ private void initOBD(){
196196
public String getIMEI(){
197197
String imei = QuickShPref.getString(QuickShPref.IEMI);
198198

199-
if(imei == null){
199+
if(imei == null || imei.length() == 0){
200200
imei =((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getDeviceId();
201+
if(imei == null)
202+
imei = "";
201203
Log.d("ieme", imei);
202204
QuickShPref.putValueObject(QuickShPref.IEMI, imei);
203205
mGetLoaction.mIMEI = imei;

src/com/obd/simpleexample/StatusInface.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.content.Context;
77
import android.os.Handler;
88
import android.os.Message;
9+
import android.os.SystemClock;
910
import android.util.Log;
1011
import com.alibaba.fastjson.JSON;
1112
import com.obd.app.bean.DROInfo;
@@ -44,19 +45,23 @@ public void vehicleResult(String result){
4445
}
4546

4647
public String mSpd = "00";
47-
48+
public long curTime = 0;
4849
public void RSOinface(JSONObject jsonString){
49-
//onStart(false);
50-
String ret = jsonString.toString().replace("-", "_");
51-
RSOInfo info = JSON.parseObject(ret, RSOInfo.class);
52-
53-
String content = String.format("%s%s#", getHead(),info.getQ());
54-
DBmanager.getInase().insert(content);
55-
56-
content = String.format("%s%s#", getHead(),info.getR());
57-
DBmanager.getInase().insert(content);
58-
59-
mSpd = info.getSpd();
50+
long time = System.currentTimeMillis();
51+
if( (time - curTime) >= 30*1000 ){
52+
curTime = time;
53+
54+
String ret = jsonString.toString().replace("-", "_");
55+
RSOInfo info = JSON.parseObject(ret, RSOInfo.class);
56+
57+
String content = String.format("%s%s#", getHead(),info.getQ());
58+
DBmanager.getInase().insert(content);
59+
60+
content = String.format("%s%s#", getHead(),info.getR());
61+
DBmanager.getInase().insert(content);
62+
63+
mSpd = info.getSpd();
64+
}
6065
}
6166

6267
public void DROinface(JSONObject jsonString){

src/com/obd/widget/GetLoaction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public String uploadPos(BDLocation location) {
128128
} catch (IOException e) {
129129
// TODO Auto-generated catch block
130130
e.printStackTrace();
131-
}
131+
}
132132
}else{
133133
DROInfo mDROInfo = StatusInface.getInstance().getDROInfo();
134134
if(mDROInfo != null){

0 commit comments

Comments
 (0)