diff --git a/app/build.gradle b/app/build.gradle index 8090931..0b913e1 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -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') //极光推送 diff --git a/app/libs/BaiduLBS_Android.jar b/app/libs/BaiduLBS_Android.jar old mode 100755 new mode 100644 index eb51137..5978516 Binary files a/app/libs/BaiduLBS_Android.jar and b/app/libs/BaiduLBS_Android.jar differ diff --git a/app/libs/arm64-v8a/libBaiduMapSDK_base_v6_0_0.so b/app/libs/arm64-v8a/libBaiduMapSDK_base_v6_0_0.so deleted file mode 100755 index 275df2e..0000000 Binary files a/app/libs/arm64-v8a/libBaiduMapSDK_base_v6_0_0.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libBaiduMapSDK_base_v7_6_2.so b/app/libs/arm64-v8a/libBaiduMapSDK_base_v7_6_2.so new file mode 100644 index 0000000..d419d66 Binary files /dev/null and b/app/libs/arm64-v8a/libBaiduMapSDK_base_v7_6_2.so differ diff --git a/app/libs/arm64-v8a/libBaiduMapSDK_bikenavi_v5_4_0.so b/app/libs/arm64-v8a/libBaiduMapSDK_bikenavi_v5_4_0.so deleted file mode 100755 index a2d8cc6..0000000 Binary files a/app/libs/arm64-v8a/libBaiduMapSDK_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so b/app/libs/arm64-v8a/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so deleted file mode 100755 index 9c98621..0000000 Binary files a/app/libs/arm64-v8a/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libBaiduMapSDK_map_v6_0_0.so b/app/libs/arm64-v8a/libBaiduMapSDK_map_v6_0_0.so deleted file mode 100755 index a8df920..0000000 Binary files a/app/libs/arm64-v8a/libBaiduMapSDK_map_v6_0_0.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libBaiduMapSDK_map_v7_6_2.so b/app/libs/arm64-v8a/libBaiduMapSDK_map_v7_6_2.so new file mode 100644 index 0000000..2399334 Binary files /dev/null and b/app/libs/arm64-v8a/libBaiduMapSDK_map_v7_6_2.so differ diff --git a/app/libs/arm64-v8a/libapp_BaiduPanoramaAppLib.so b/app/libs/arm64-v8a/libapp_BaiduPanoramaAppLib.so deleted file mode 100755 index 3aa174a..0000000 Binary files a/app/libs/arm64-v8a/libapp_BaiduPanoramaAppLib.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libc++_shared.so b/app/libs/arm64-v8a/libc++_shared.so new file mode 100644 index 0000000..bd68444 Binary files /dev/null and b/app/libs/arm64-v8a/libc++_shared.so differ diff --git a/app/libs/arm64-v8a/libindoor.so b/app/libs/arm64-v8a/libindoor.so old mode 100755 new mode 100644 index bfb6f75..8b55e4c Binary files a/app/libs/arm64-v8a/libindoor.so and b/app/libs/arm64-v8a/libindoor.so differ diff --git a/app/libs/arm64-v8a/libjcore201.so b/app/libs/arm64-v8a/libjcore201.so deleted file mode 100755 index 2ee8e0f..0000000 Binary files a/app/libs/arm64-v8a/libjcore201.so and /dev/null differ diff --git a/app/libs/arm64-v8a/liblocSDK8a.so b/app/libs/arm64-v8a/liblocSDK8a.so deleted file mode 100755 index cd47e16..0000000 Binary files a/app/libs/arm64-v8a/liblocSDK8a.so and /dev/null differ diff --git a/app/libs/arm64-v8a/liblocSDK8b.so b/app/libs/arm64-v8a/liblocSDK8b.so new file mode 100644 index 0000000..5b0d7af Binary files /dev/null and b/app/libs/arm64-v8a/liblocSDK8b.so differ diff --git a/app/libs/arm64-v8a/libtiny_magic.so b/app/libs/arm64-v8a/libtiny_magic.so new file mode 100644 index 0000000..e6f049e Binary files /dev/null and b/app/libs/arm64-v8a/libtiny_magic.so differ diff --git a/app/libs/armeabi-v7a/libBaiduMapSDK_base_v6_0_0.so b/app/libs/armeabi-v7a/libBaiduMapSDK_base_v6_0_0.so deleted file mode 100755 index 2685834..0000000 Binary files a/app/libs/armeabi-v7a/libBaiduMapSDK_base_v6_0_0.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/libBaiduMapSDK_base_v7_6_2.so b/app/libs/armeabi-v7a/libBaiduMapSDK_base_v7_6_2.so new file mode 100644 index 0000000..30d2b49 Binary files /dev/null and b/app/libs/armeabi-v7a/libBaiduMapSDK_base_v7_6_2.so differ diff --git a/app/libs/armeabi-v7a/libBaiduMapSDK_bikenavi_v5_4_0.so b/app/libs/armeabi-v7a/libBaiduMapSDK_bikenavi_v5_4_0.so deleted file mode 100755 index eeb2075..0000000 Binary files a/app/libs/armeabi-v7a/libBaiduMapSDK_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so b/app/libs/armeabi-v7a/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so deleted file mode 100755 index f2db8b0..0000000 Binary files a/app/libs/armeabi-v7a/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/libBaiduMapSDK_map_v6_0_0.so b/app/libs/armeabi-v7a/libBaiduMapSDK_map_v6_0_0.so deleted file mode 100755 index 7abbf31..0000000 Binary files a/app/libs/armeabi-v7a/libBaiduMapSDK_map_v6_0_0.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/libBaiduMapSDK_map_v7_6_2.so b/app/libs/armeabi-v7a/libBaiduMapSDK_map_v7_6_2.so new file mode 100644 index 0000000..01d7876 Binary files /dev/null and b/app/libs/armeabi-v7a/libBaiduMapSDK_map_v7_6_2.so differ diff --git a/app/libs/armeabi-v7a/libapp_BaiduPanoramaAppLib.so b/app/libs/armeabi-v7a/libapp_BaiduPanoramaAppLib.so deleted file mode 100755 index 716d03d..0000000 Binary files a/app/libs/armeabi-v7a/libapp_BaiduPanoramaAppLib.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/libc++_shared.so b/app/libs/armeabi-v7a/libc++_shared.so new file mode 100644 index 0000000..5958937 Binary files /dev/null and b/app/libs/armeabi-v7a/libc++_shared.so differ diff --git a/app/libs/armeabi-v7a/libindoor.so b/app/libs/armeabi-v7a/libindoor.so old mode 100755 new mode 100644 index b59be91..e14d583 Binary files a/app/libs/armeabi-v7a/libindoor.so and b/app/libs/armeabi-v7a/libindoor.so differ diff --git a/app/libs/armeabi-v7a/libjcore201.so b/app/libs/armeabi-v7a/libjcore201.so deleted file mode 100755 index 05ff4aa..0000000 Binary files a/app/libs/armeabi-v7a/libjcore201.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/liblocSDK8a.so b/app/libs/armeabi-v7a/liblocSDK8a.so deleted file mode 100755 index 0c6e58c..0000000 Binary files a/app/libs/armeabi-v7a/liblocSDK8a.so and /dev/null differ diff --git a/app/libs/armeabi-v7a/liblocSDK8b.so b/app/libs/armeabi-v7a/liblocSDK8b.so new file mode 100644 index 0000000..c14b919 Binary files /dev/null and b/app/libs/armeabi-v7a/liblocSDK8b.so differ diff --git a/app/libs/armeabi-v7a/libtiny_magic.so b/app/libs/armeabi-v7a/libtiny_magic.so new file mode 100644 index 0000000..0984f80 Binary files /dev/null and b/app/libs/armeabi-v7a/libtiny_magic.so differ diff --git a/app/libs/armeabi/libBaiduMapSDK_base_v6_0_0.so b/app/libs/armeabi/libBaiduMapSDK_base_v6_0_0.so deleted file mode 100755 index 77f049e..0000000 Binary files a/app/libs/armeabi/libBaiduMapSDK_base_v6_0_0.so and /dev/null differ diff --git a/app/libs/armeabi/libBaiduMapSDK_bikenavi_v5_4_0.so b/app/libs/armeabi/libBaiduMapSDK_bikenavi_v5_4_0.so deleted file mode 100755 index 0762fcf..0000000 Binary files a/app/libs/armeabi/libBaiduMapSDK_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/armeabi/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so b/app/libs/armeabi/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so deleted file mode 100755 index d02e2fc..0000000 Binary files a/app/libs/armeabi/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/armeabi/libBaiduMapSDK_map_v6_0_0.so b/app/libs/armeabi/libBaiduMapSDK_map_v6_0_0.so deleted file mode 100755 index d3d829e..0000000 Binary files a/app/libs/armeabi/libBaiduMapSDK_map_v6_0_0.so and /dev/null differ diff --git a/app/libs/armeabi/libapp_BaiduPanoramaAppLib.so b/app/libs/armeabi/libapp_BaiduPanoramaAppLib.so deleted file mode 100755 index c7d1d92..0000000 Binary files a/app/libs/armeabi/libapp_BaiduPanoramaAppLib.so and /dev/null differ diff --git a/app/libs/armeabi/libindoor.so b/app/libs/armeabi/libindoor.so deleted file mode 100755 index a0879cf..0000000 Binary files a/app/libs/armeabi/libindoor.so and /dev/null differ diff --git a/app/libs/armeabi/libjcore201.so b/app/libs/armeabi/libjcore201.so deleted file mode 100755 index 1aa7654..0000000 Binary files a/app/libs/armeabi/libjcore201.so and /dev/null differ diff --git a/app/libs/armeabi/liblocSDK8a.so b/app/libs/armeabi/liblocSDK8a.so deleted file mode 100755 index 5286996..0000000 Binary files a/app/libs/armeabi/liblocSDK8a.so and /dev/null differ diff --git a/app/libs/x86/libBaiduMapSDK_base_v6_0_0.so b/app/libs/x86/libBaiduMapSDK_base_v6_0_0.so deleted file mode 100755 index 0f3e255..0000000 Binary files a/app/libs/x86/libBaiduMapSDK_base_v6_0_0.so and /dev/null differ diff --git a/app/libs/x86/libBaiduMapSDK_base_v7_6_2.so b/app/libs/x86/libBaiduMapSDK_base_v7_6_2.so new file mode 100644 index 0000000..f6b4661 Binary files /dev/null and b/app/libs/x86/libBaiduMapSDK_base_v7_6_2.so differ diff --git a/app/libs/x86/libBaiduMapSDK_bikenavi_v5_4_0.so b/app/libs/x86/libBaiduMapSDK_bikenavi_v5_4_0.so deleted file mode 100755 index b38e98f..0000000 Binary files a/app/libs/x86/libBaiduMapSDK_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/x86/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so b/app/libs/x86/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so deleted file mode 100755 index 513411c..0000000 Binary files a/app/libs/x86/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/x86/libBaiduMapSDK_map_v6_0_0.so b/app/libs/x86/libBaiduMapSDK_map_v6_0_0.so deleted file mode 100755 index be7cd25..0000000 Binary files a/app/libs/x86/libBaiduMapSDK_map_v6_0_0.so and /dev/null differ diff --git a/app/libs/x86/libBaiduMapSDK_map_v7_6_2.so b/app/libs/x86/libBaiduMapSDK_map_v7_6_2.so new file mode 100644 index 0000000..9c20bc6 Binary files /dev/null and b/app/libs/x86/libBaiduMapSDK_map_v7_6_2.so differ diff --git a/app/libs/x86/libapp_BaiduPanoramaAppLib.so b/app/libs/x86/libapp_BaiduPanoramaAppLib.so deleted file mode 100755 index 6fdfda4..0000000 Binary files a/app/libs/x86/libapp_BaiduPanoramaAppLib.so and /dev/null differ diff --git a/app/libs/x86/libc++_shared.so b/app/libs/x86/libc++_shared.so new file mode 100644 index 0000000..a2d2719 Binary files /dev/null and b/app/libs/x86/libc++_shared.so differ diff --git a/app/libs/x86/libindoor.so b/app/libs/x86/libindoor.so deleted file mode 100755 index 1de0a2c..0000000 Binary files a/app/libs/x86/libindoor.so and /dev/null differ diff --git a/app/libs/x86/libjcore201.so b/app/libs/x86/libjcore201.so deleted file mode 100755 index 40e5493..0000000 Binary files a/app/libs/x86/libjcore201.so and /dev/null differ diff --git a/app/libs/x86/liblocSDK8a.so b/app/libs/x86/liblocSDK8a.so deleted file mode 100755 index cc24465..0000000 Binary files a/app/libs/x86/liblocSDK8a.so and /dev/null differ diff --git a/app/libs/x86/liblocSDK8b.so b/app/libs/x86/liblocSDK8b.so new file mode 100644 index 0000000..62a9a60 Binary files /dev/null and b/app/libs/x86/liblocSDK8b.so differ diff --git a/app/libs/x86/libtiny_magic.so b/app/libs/x86/libtiny_magic.so new file mode 100644 index 0000000..bd9c108 Binary files /dev/null and b/app/libs/x86/libtiny_magic.so differ diff --git a/app/libs/x86_64/libBaiduMapSDK_base_v6_0_0.so b/app/libs/x86_64/libBaiduMapSDK_base_v6_0_0.so deleted file mode 100755 index ca00551..0000000 Binary files a/app/libs/x86_64/libBaiduMapSDK_base_v6_0_0.so and /dev/null differ diff --git a/app/libs/x86_64/libBaiduMapSDK_base_v7_6_2.so b/app/libs/x86_64/libBaiduMapSDK_base_v7_6_2.so new file mode 100644 index 0000000..0529f70 Binary files /dev/null and b/app/libs/x86_64/libBaiduMapSDK_base_v7_6_2.so differ diff --git a/app/libs/x86_64/libBaiduMapSDK_bikenavi_v5_4_0.so b/app/libs/x86_64/libBaiduMapSDK_bikenavi_v5_4_0.so deleted file mode 100755 index 22c2320..0000000 Binary files a/app/libs/x86_64/libBaiduMapSDK_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/x86_64/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so b/app/libs/x86_64/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so deleted file mode 100755 index 51bc1ab..0000000 Binary files a/app/libs/x86_64/libBaiduMapSDK_map_for_bikenavi_v5_4_0.so and /dev/null differ diff --git a/app/libs/x86_64/libBaiduMapSDK_map_v6_0_0.so b/app/libs/x86_64/libBaiduMapSDK_map_v6_0_0.so deleted file mode 100755 index fa166ef..0000000 Binary files a/app/libs/x86_64/libBaiduMapSDK_map_v6_0_0.so and /dev/null differ diff --git a/app/libs/x86_64/libBaiduMapSDK_map_v7_6_2.so b/app/libs/x86_64/libBaiduMapSDK_map_v7_6_2.so new file mode 100644 index 0000000..e15da23 Binary files /dev/null and b/app/libs/x86_64/libBaiduMapSDK_map_v7_6_2.so differ diff --git a/app/libs/x86_64/libapp_BaiduPanoramaAppLib.so b/app/libs/x86_64/libapp_BaiduPanoramaAppLib.so deleted file mode 100755 index 090a2e4..0000000 Binary files a/app/libs/x86_64/libapp_BaiduPanoramaAppLib.so and /dev/null differ diff --git a/app/libs/x86_64/libc++_shared.so b/app/libs/x86_64/libc++_shared.so new file mode 100644 index 0000000..d569d37 Binary files /dev/null and b/app/libs/x86_64/libc++_shared.so differ diff --git a/app/libs/x86_64/libindoor.so b/app/libs/x86_64/libindoor.so deleted file mode 100755 index 80a00c6..0000000 Binary files a/app/libs/x86_64/libindoor.so and /dev/null differ diff --git a/app/libs/x86_64/libjcore201.so b/app/libs/x86_64/libjcore201.so deleted file mode 100755 index 79009e5..0000000 Binary files a/app/libs/x86_64/libjcore201.so and /dev/null differ diff --git a/app/libs/x86_64/liblocSDK8a.so b/app/libs/x86_64/liblocSDK8a.so deleted file mode 100755 index b66eb9a..0000000 Binary files a/app/libs/x86_64/liblocSDK8a.so and /dev/null differ diff --git a/app/libs/x86_64/liblocSDK8b.so b/app/libs/x86_64/liblocSDK8b.so new file mode 100644 index 0000000..4fe4fe8 Binary files /dev/null and b/app/libs/x86_64/liblocSDK8b.so differ diff --git a/app/libs/x86_64/libtiny_magic.so b/app/libs/x86_64/libtiny_magic.so new file mode 100644 index 0000000..3a912a2 Binary files /dev/null and b/app/libs/x86_64/libtiny_magic.so differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 01432b2..682c815 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -10,8 +10,8 @@ { "type": "SINGLE", "filters": [], - "versionCode": 52, - "versionName": "1.5.2", + "versionCode": 53, + "versionName": "1.5.3", "outputFile": "app-release.apk" } ] diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/base/MainActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/base/MainActivity.java index 7ee201d..a1f7057 100755 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/base/MainActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/base/MainActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddBuildingActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddBuildingActivity.java index d8ac746..0e777a9 100644 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddBuildingActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddBuildingActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddHouseActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddHouseActivity.java index d2ecddf..89d1e9b 100644 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddHouseActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/AddHouseActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditBuildingActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditBuildingActivity.java index 7177b35..c272268 100644 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditBuildingActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditBuildingActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditHouseActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditHouseActivity.java index 8dd01eb..8218d40 100644 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditHouseActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/house/EditHouseActivity.java @@ -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() { - @Override - public void onSubscribe(Disposable d) { + .create(LocationApiService.class) + .getHouseDetailById(mId, UserLgUtils.getToken()) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Observer() { + @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() { - @Override - public void onSubscribe(Disposable d) { + .create(LocationApiService.class) + .doUpdateHouse(mId, body, UserLgUtils.getToken()) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Observer() { + @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(); } } \ No newline at end of file diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/common/WorkSignActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/common/WorkSignActivity.java index 7932ed8..ab430e4 100644 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/common/WorkSignActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/common/WorkSignActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/issue/TakePointActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/issue/TakePointActivity.java index 31485bc..c9382de 100755 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/issue/TakePointActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/issue/TakePointActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/locus/LocusMapActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/locus/LocusMapActivity.java index 5507157..97724b6 100755 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/locus/LocusMapActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/locus/LocusMapActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/mine/WorkLogAddActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/mine/WorkLogAddActivity.java index b7b3526..19be8f7 100644 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/mine/WorkLogAddActivity.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/mine/WorkLogAddActivity.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/base/BaseApplication.java b/app/src/main/java/com/sucstepsoft/realtimelocation/base/BaseApplication.java index b19f62f..e8a9f7b 100755 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/base/BaseApplication.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/base/BaseApplication.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/services/LocationService.java b/app/src/main/java/com/sucstepsoft/realtimelocation/services/LocationService.java index 0741886..4e3ef4a 100755 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/services/LocationService.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/services/LocationService.java @@ -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() { diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/services/NotificationService.java b/app/src/main/java/com/sucstepsoft/realtimelocation/services/NotificationService.java index 604775e..791d772 100755 --- a/app/src/main/java/com/sucstepsoft/realtimelocation/services/NotificationService.java +++ b/app/src/main/java/com/sucstepsoft/realtimelocation/services/NotificationService.java @@ -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() { diff --git a/build.gradle b/build.gradle index c1a0590..41619dc 100755 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/camera/src/androidTest/java/com/cjt2325/cameralibrary/ApplicationTest.java b/camera/src/androidTest/java/com/cjt2325/cameralibrary/ApplicationTest.java deleted file mode 100755 index c8fffee..0000000 --- a/camera/src/androidTest/java/com/cjt2325/cameralibrary/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.cjt2325.cameralibrary; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/cm_utils/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/cm_utils/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100755 index eca70cf..0000000 --- a/cm_utils/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cm_utils/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/cm_utils/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100755 index eca70cf..0000000 --- a/cm_utils/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file