升级地图

This commit is contained in:
itgaojian 2024-12-16 19:02:16 +08:00
parent 9dca2eb1cc
commit a210905cca
79 changed files with 321 additions and 312 deletions

View File

@ -70,6 +70,9 @@ dependencies {
implementation project(':cm_utils')
implementation project(':camera')
//
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Map:7.6.2'
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location_All:9.6.4'
// implementation "com.baidu.lbsyun:BaiduMapSDK_Util:7.6.2"
implementation files('libs/BaiduLBS_Android.jar')
implementation files('libs/IndoorscapeAlbumPlugin.jar')
//

BIN
app/libs/BaiduLBS_Android.jar Executable file → Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
app/libs/arm64-v8a/libindoor.so Executable file → Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
app/libs/armeabi-v7a/libindoor.so Executable file → Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
app/libs/x86/liblocSDK8b.so Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 52,
"versionName": "1.5.2",
"versionCode": 53,
"versionName": "1.5.3",
"outputFile": "app-release.apk"
}
]

View File

@ -55,7 +55,6 @@ import com.sucstepsoft.realtimelocation.ScreenManager;
import com.sucstepsoft.realtimelocation.activitys.addresslist.AddressListMainActivity;
import com.sucstepsoft.realtimelocation.activitys.census.house.NewSearchHouseByPersonActivity;
import com.sucstepsoft.realtimelocation.activitys.census.house.NewSearchPersonByHouseActivity;
import com.sucstepsoft.realtimelocation.activitys.census.house.SearchPersonByHouseActivity;
import com.sucstepsoft.realtimelocation.activitys.census.newhouse.activitys.BuildingViewPageActivity;
import com.sucstepsoft.realtimelocation.activitys.census.newhouse.activitys.NewGroupHouseAddActivity;
import com.sucstepsoft.realtimelocation.activitys.census.newhouse.activitys.NewRuleHouseAddActivity;
@ -1620,26 +1619,30 @@ public class MainActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
// locationOption.setLocationPurpose(LocationClientOption.BDLocationPurpose.SignIn);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -3,31 +3,23 @@ package com.sucstepsoft.realtimelocation.activitys.census.house;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.google.gson.Gson;
import com.sucstepsoft.cm_utils.constant.RegexConstants;
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.cm_utils.utils.RegexUtils;
import com.sucstepsoft.cm_utils.utils.ToastUtils;
import com.sucstepsoft.cm_utils.utils.UIUtil;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.realtimelocation.R;
import com.sucstepsoft.realtimelocation.activitys.base.MainActivity;
import com.sucstepsoft.realtimelocation.activitys.issue.IssueReportActivity;
import com.sucstepsoft.realtimelocation.activitys.issue.TakePointActivity;
import com.sucstepsoft.realtimelocation.beans.BuildingSaveBean;
import com.sucstepsoft.realtimelocation.beans.SuccessBean;
@ -189,25 +181,29 @@ public class AddBuildingActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -4,8 +4,6 @@ import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;
@ -14,7 +12,6 @@ import android.widget.TextView;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
import com.bigkoo.pickerview.view.OptionsPickerView;
import com.google.gson.Gson;
@ -26,7 +23,6 @@ import com.sucstepsoft.cm_utils.utils.UIUtil;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.realtimelocation.R;
import com.sucstepsoft.realtimelocation.activitys.issue.TakePointActivity;
import com.sucstepsoft.realtimelocation.beans.BuildingSaveBean;
import com.sucstepsoft.realtimelocation.beans.HouseSaveBean;
import com.sucstepsoft.realtimelocation.beans.SuccessBean;
import com.sucstepsoft.realtimelocation.beans.TypeUserBean;
@ -236,25 +232,11 @@ public class AddHouseActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -239,25 +239,29 @@ public class EditBuildingActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -107,33 +107,33 @@ public class EditHouseActivity extends BaseActivity {
*/
private void getHouseDetail() {
RetrofitManager.getInstance()
.create(LocationApiService.class)
.getHouseDetailById(mId, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BuildHouseDetailBean>() {
@Override
public void onSubscribe(Disposable d) {
.create(LocationApiService.class)
.getHouseDetailById(mId, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BuildHouseDetailBean>() {
@Override
public void onSubscribe(Disposable d) {
}
}
@Override
public void onNext(BuildHouseDetailBean bean) {
mDetailBean = bean;
//获取绑定的人员
setDataToView();
}
@Override
public void onNext(BuildHouseDetailBean bean) {
mDetailBean = bean;
//获取绑定的人员
setDataToView();
}
@Override
public void onError(Throwable e) {
@Override
public void onError(Throwable e) {
}
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
private boolean checkParams() {
@ -215,11 +215,11 @@ public class EditHouseActivity extends BaseActivity {
mLlTime.setVisibility(View.GONE);
}
})
.setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
.setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mTypePicker.setPicker(mTypes);
mTypePicker.show();
}
@ -236,35 +236,35 @@ public class EditHouseActivity extends BaseActivity {
ProgressDialog progressDialog = UIUtil.initDialog(EditHouseActivity.this, "修改中...");
progressDialog.show();
RetrofitManager.getInstance()
.create(LocationApiService.class)
.doUpdateHouse(mId, body, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SuccessBean>() {
@Override
public void onSubscribe(Disposable d) {
.create(LocationApiService.class)
.doUpdateHouse(mId, body, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SuccessBean>() {
@Override
public void onSubscribe(Disposable d) {
}
}
@Override
public void onNext(SuccessBean s) {
setResult(123, new Intent());
progressDialog.dismiss();
ToastUtils.showShort("修改成功");
finish();
}
@Override
public void onNext(SuccessBean s) {
setResult(123, new Intent());
progressDialog.dismiss();
ToastUtils.showShort("修改成功");
finish();
}
@Override
public void onError(Throwable e) {
progressDialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onError(Throwable e) {
progressDialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
}
@ -297,25 +297,30 @@ public class EditHouseActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {
@ -381,12 +386,12 @@ public class EditHouseActivity extends BaseActivity {
TimePickerView mTimePickerView = new TimePickerBuilder(mActivity, (date, v) -> {
mTvTime.setText(mDateFormat.format(date));
})
.setTitleText("请选日期")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setType(new boolean[]{true, true, true, false, false, false})
.setTitleColor(Color.parseColor("#1189FF"))
.build();
.setTitleText("请选日期")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setType(new boolean[]{true, true, true, false, false, false})
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mTimePickerView.show();
}
}

View File

@ -799,25 +799,31 @@ public class WorkSignActivity extends BaseActivity {
*/
private void startLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -260,25 +260,30 @@ public class TakePointActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -963,25 +963,30 @@ public class LocusMapActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -609,24 +609,29 @@ public class WorkLogAddActivity extends BaseActivity {
private void startSignLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
mLocationClient.start();
try {
mLocationClient = new LocationClient(getApplicationContext());
LocationClientOption locationOption = new LocationClientOption();
SignLocationListener myLocationListener = new SignLocationListener();
mLocationClient.registerLocationListener(myLocationListener);
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
locationOption.setCoorType("bd09ll");
locationOption.setScanSpan(30 * 1000);
locationOption.setIsNeedAddress(true);
locationOption.setNeedDeviceDirect(false);
locationOption.setLocationNotify(false);
locationOption.setIgnoreKillProcess(true);
locationOption.setIsNeedLocationDescribe(true);
locationOption.setIsNeedLocationPoiList(true);
locationOption.SetIgnoreCacheException(false);
locationOption.setOpenGps(true);
locationOption.setIsNeedAltitude(false);
mLocationClient.setLocOption(locationOption);
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void stopLocation() {

View File

@ -5,12 +5,11 @@ import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.view.Gravity;
import com.baidu.location.LocationClient;
import com.baidu.mapapi.CoordType;
import com.baidu.mapapi.SDKInitializer;
import com.hjq.toast.Toaster;
import com.squareup.leakcanary.LeakCanary;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.realtimelocation.services.LocationChangBroadcastReceiver;
import com.tencent.bugly.crashreport.CrashReport;
import cn.jpush.android.api.JPushInterface;
@ -60,10 +59,12 @@ public class BaseApplication extends MultiDexApplication {
* 百度地图初始化
*/
private void initBaiduMap() {
SDKInitializer.setAgreePrivacy(this, true);
SDKInitializer.initialize(this);
//自4.3.0起百度地图SDK所有接口均支持百度坐标和国测局坐标用此方法设置您使用的坐标类型.
//包括BD09LL和GCJ02两种坐标默认是BD09LL坐标
SDKInitializer.setCoordType(CoordType.BD09LL);
LocationClient.setAgreePrivacy(true);
}
// public static LocationChangBroadcastReceiver getlocationChangeBoardcase() {

View File

@ -1269,46 +1269,51 @@ public class LocationService extends NotificationService {
*/
private void startLocation() {
stopLocation();
mLocationClient = new LocationClient(getApplicationContext());
//声明LocationClient类实例并配置定位参数
LocationClientOption locationOption = new LocationClientOption();
MyLocationListener myLocationListener = new MyLocationListener();
//注册监听函数
mLocationClient.registerLocationListener(myLocationListener);
//可选默认高精度设置定位模式高精度低功耗仅设备
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
//可选默认gcj02设置返回的定位结果坐标系如果配合百度地图使用建议设置为bd09ll;
locationOption.setCoorType("bd09ll");
//可选默认0即仅定位一次设置发起连续定位请求的间隔需要大于等于1000ms才是有效的
locationOption.setScanSpan(5000);
//可选设置是否需要地址信息默认不需要
locationOption.setIsNeedAddress(true);
//设置是否运行模拟GPS
try {
mLocationClient = new LocationClient(getApplicationContext());
//声明LocationClient类实例并配置定位参数
LocationClientOption locationOption = new LocationClientOption();
MyLocationListener myLocationListener = new MyLocationListener();
//注册监听函数
mLocationClient.registerLocationListener(myLocationListener);
//可选默认高精度设置定位模式高精度低功耗仅设备
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
//可选默认gcj02设置返回的定位结果坐标系如果配合百度地图使用建议设置为bd09ll;
locationOption.setCoorType("bd09ll");
//可选默认0即仅定位一次设置发起连续定位请求的间隔需要大于等于1000ms才是有效的
locationOption.setScanSpan(5000);
//可选设置是否需要地址信息默认不需要
locationOption.setIsNeedAddress(true);
//设置是否运行模拟GPS
// locationOption.setEnableSimulateGps(false);
//可选设置是否需要设备方向结果
locationOption.setNeedDeviceDirect(false);
//可选默认false设置是否当gps有效时按照1S1次频率输出GPS结果
locationOption.setLocationNotify(true);
//可选默认true定位SDK内部是一个SERVICE并放到了独立进程设置是否在stop的时候杀死这个进程默认不杀死
locationOption.setIgnoreKillProcess(true);
//可选默认false设置是否需要位置语义化结果可以在BDLocation.getLocationDescribe里得到结果类似于在北京天安门附近
locationOption.setIsNeedLocationDescribe(true);
//可选默认false设置是否需要POI结果可以在BDLocation.getPoiList里得到
locationOption.setIsNeedLocationPoiList(true);
//可选默认false设置是否收集CRASH信息默认收集
locationOption.SetIgnoreCacheException(false);
//可选默认false设置是否开启Gps定位
locationOption.setOpenGps(true);
//可选默认false设置定位时是否需要海拔信息默认不需要除基础定位版本都可用
locationOption.setIsNeedAltitude(false);
//设置打开自动回调位置模式该开关打开后期间只要定位SDK检测到位置变化就会主动回调给开发者该模式下开发者无需再关心定位间隔是多少定位SDK本身发现位置变化就会及时回调给开发者
//可选设置是否需要设备方向结果
locationOption.setNeedDeviceDirect(false);
//可选默认false设置是否当gps有效时按照1S1次频率输出GPS结果
locationOption.setLocationNotify(true);
//可选默认true定位SDK内部是一个SERVICE并放到了独立进程设置是否在stop的时候杀死这个进程默认不杀死
locationOption.setIgnoreKillProcess(true);
//可选默认false设置是否需要位置语义化结果可以在BDLocation.getLocationDescribe里得到结果类似于在北京天安门附近
locationOption.setIsNeedLocationDescribe(true);
//可选默认false设置是否需要POI结果可以在BDLocation.getPoiList里得到
locationOption.setIsNeedLocationPoiList(true);
//可选默认false设置是否收集CRASH信息默认收集
locationOption.SetIgnoreCacheException(false);
//可选默认false设置是否开启Gps定位
locationOption.setOpenGps(true);
//可选默认false设置定位时是否需要海拔信息默认不需要除基础定位版本都可用
locationOption.setIsNeedAltitude(false);
//设置打开自动回调位置模式该开关打开后期间只要定位SDK检测到位置变化就会主动回调给开发者该模式下开发者无需再关心定位间隔是多少定位SDK本身发现位置变化就会及时回调给开发者
// locationOption.setOpenAutoNotifyMode();
//设置打开自动回调位置模式该开关打开后期间只要定位SDK检测到位置变化就会主动回调给开发者
//设置打开自动回调位置模式该开关打开后期间只要定位SDK检测到位置变化就会主动回调给开发者
// locationOption.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT);
//需将配置好的LocationClientOption对象通过setLocOption方法传递给LocationClient对象使用
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
//需将配置好的LocationClientOption对象通过setLocOption方法传递给LocationClient对象使用
mLocationClient.setLocOption(locationOption);
//开始定位
mLocationClient.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
void stopLocation() {

View File

@ -20,7 +20,7 @@ public class NotificationService extends Service {
*/
// private static int NOTI_ID = 123321;
private static int NOTI_ID = 123322;
// private static int NOTI_ID_1 = 123443;
// private static int NOTI_ID_1 = 123443;
private static int NOTI_ID_1 = 123444;
private Utils.CloseServiceReceiver mCloseReceiver;
@ -50,12 +50,12 @@ public class NotificationService extends Service {
* 触发利用notification增加进程优先级
*/
protected void applyNotiKeepMech() {
startForeground(NOTI_ID, Utils.buildNotification(getBaseContext()));
startForeground(NOTI_ID, Utils.buildNotification(this.getApplicationContext()));
startBindHelperService();
}
protected void sendNoti() {
startForeground(NOTI_ID_1, Utils.buildNotification(getBaseContext()));
startForeground(NOTI_ID_1, Utils.buildNotification(getApplicationContext()));
}
public void unApplyNotiKeepMech() {

View File

@ -3,8 +3,15 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
// https://maven.aliyun.com/mvn/guide
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
// https://mirrors.huaweicloud.com
maven { url 'https://repo.huaweicloud.com/repository/maven' }
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
@ -45,7 +52,12 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
// https://maven.aliyun.com/mvn/guide
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
// https://mirrors.huaweicloud.com
maven { url 'https://repo.huaweicloud.com/repository/maven' }
maven {
url "https://jitpack.io"
}
@ -61,12 +73,12 @@ ext {
gTargetSdkVersion = 28
// gVersionCode = 3
// gVersionName = '1.0.3'
gVersionCode=52
gVersionName='1.5.2'
gVersionCode = 53
gVersionName = '1.5.3'
//Router编译版本
gRouterApiVersion = '1.4.1'
gRouterCompileVersion = '1.2.2'
//appcompat
//appcompatb
gAppcompatVersion_v7_28 = '28.0.0'
//constraint-layout
gConstraint_layout = '1.1.3'

View File

@ -1,13 +0,0 @@
package com.cjt2325.cameralibrary;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>