From e238b9cc3caef879fd907ceab8997d08ae891ea3 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 04 十一月 2021 09:22:08 +0800
Subject: [PATCH] BUG修复
---
HDL-ON_Android/Application.cs | 75 ++++++++++++++++++++++++++++---------
1 files changed, 57 insertions(+), 18 deletions(-)
diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs
index b8dd1ec..52059fc 100644
--- a/HDL-ON_Android/Application.cs
+++ b/HDL-ON_Android/Application.cs
@@ -11,6 +11,9 @@
using CN.Jpush.Android.Api;
using HDL_ON;
using Java.Util;
+using Microsoft.AppCenter;
+using Microsoft.AppCenter.Analytics;
+using Microsoft.AppCenter.Crashes;
using Shared;
namespace HDL_ON_Android
@@ -33,8 +36,7 @@
public override void OnCreate()
{
//娉ㄥ唽鏈鐞嗗紓甯镐簨浠�
-
- Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "cb89f20750");
+ AppCenter.Start("64ac5859-2cd7-4ef8-a5da-5455e29679ec", typeof(Analytics), typeof(Crashes));
if (Shared.Application.Activity != null)
{
reStartApp(this);
@@ -47,6 +49,9 @@
initAll();
}
+
+
+
/// <summary>
/// 鎵�鏈夊垵濮嬪寲鍏ㄩ儴鍦ㄨ繖涓柟娉曞疄鐜�
/// </summary>
@@ -57,8 +62,34 @@
Manifest.Permission.Camera, Manifest.Permission.ProcessOutgoingCalls, Manifest.Permission.GetAccounts};
//绂佹灞忓箷闀夸寒
BaseActivity.KeepScreenON = false;
- //闅愯棌杩嫓铏氭嫙鎸夐敭
+ //闅愯棌铏氭嫙鎸夐敭
BaseActivity.IsHideVirualButtons = true;
+ //瀹炵幇瀹夊崜杩斿洖鎸夐敭
+ BaseActivity.BackKeyAction = () =>
+ {
+ try
+ {
+ var result = MainPage.LoadEvent_BackAction();
+ switch (result)
+ {
+ case 0:
+ break;
+ case 1:
+ case 2:
+ BaseActivity.VerifyDateTime = DateTime.MaxValue;
+ break;
+ default:
+ BaseActivity.VerifyDateTime = DateTime.MaxValue;
+ break;
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log(ex.Message);
+ BaseActivity.VerifyDateTime = DateTime.MaxValue;
+ }
+ };
+
init();
BaseActivity.OnCreateActoin += (activity, application) =>
{
@@ -69,7 +100,10 @@
{
Language.CurrentLanguage = "Chinese";
}
-
+ else
+ {
+ Language.CurrentLanguage = "English";
+ }
//鑾峰彇鏋佸厜鎺ㄩ�両D
GetJPushRegistrationID(activity);
@@ -94,8 +128,6 @@
//缃戠粶鍙樺寲澶勭悊
HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground);
};
- //寮�鍚畾浣嶆湇鍔�
- Shared.Application.StartGPSLocationService();
};
BaseActivity.RefreshUIAction += (activity) =>
{
@@ -105,7 +137,6 @@
BaseActivity.OnResumeAction += (activity) =>
{
checkSomeInfo();
-
};
BaseActivity.OnDestroyAction += (activity) =>
{
@@ -114,7 +145,6 @@
//UserInfo.Current.unlockTime = DateTime.Now;
};
-
HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider");
@@ -125,18 +155,16 @@
try
{
Shared.Application.LocationAction = null;
- new HDL_ON.DAL.Server.HttpServerRequest().GetCityInfo(lon.ToString(), lat.ToString());
+ new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(lon.ToString(), lat.ToString());
//鍏抽棴瀹氫綅鏈嶅姟
Shared.Application.StopGPSLocationService();
}
- catch(Exception ex)
+ catch (Exception ex)
{
- Utlis.WriteLine("GetCityInfo catch"+ ex.Message);
+ Utlis.WriteLine("GetCityInfo catch" + ex.Message);
}
MainPage.Log($"缁忕含搴�:::{lon}:{lat}");
};
-
-
}
/// <summary>
@@ -191,9 +219,9 @@
{
//鎵嬫満鍚嶇О Android.OS.Build.Manufacturer;
//OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer;
-#if DEBUG
- CN.Jpush.Android.Api.JPushInterface.SetDebugMode(true);
-#endif
+ //#if DEBUG
+ //CN.Jpush.Android.Api.JPushInterface.SetDebugMode(true);
+ //#endif
CN.Jpush.Android.Api.JPushInterface.Init(this);
}
@@ -336,7 +364,7 @@
//杩涘叆鍚庡彴mqtt姝e湪杩炴帴閲嶇疆鐘舵��
HDL_ON.DAL.Mqtt.MqttClient.RemoteMqttIsConnecting = false;
HDL_ON.DriverLayer.UdpSocket._BusSocket.Stop();
-
+
}
/// <summary>
@@ -349,7 +377,7 @@
if (CloseTime.AddSeconds(10) < DateTime.Now)
{
//鍚庡彴瓒呰繃10s灏辨柇寮�MQTT閲嶈繛
- if (HDL_ON.DriverLayer.Control.Ins.IsRemote)
+ //if (HDL_ON.DriverLayer.Control.Ins.IsRemote)
{
HDL_ON.DAL.Mqtt.MqttClient.DisConnectRemote("closeTime", false);
}
@@ -365,6 +393,17 @@
base.Dispose(disposing);
}
+ /// <summary>
+ /// 鏌ヨ閫氱煡鏉冮檺锛屽苟鎻愮ず
+ /// </summary>
+ public void QueryNotificationPermission()
+ {
+
+
+ }
+
+
+
}
}
--
Gitblit v1.8.0