From 5a5a2b696866f947b6025d26c3302e8ffef46435 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期一, 11 一月 2021 16:11:20 +0800 Subject: [PATCH] 2021-01-11 1.更新MQTT连接和本地搜索网关方法。2.子账号相关接口完善 --- Crabtree/ON/Application.cs | 35 +++++++++++------------------------ 1 files changed, 11 insertions(+), 24 deletions(-) diff --git a/Crabtree/ON/Application.cs b/Crabtree/ON/Application.cs index 281ae60..0e4c578 100644 --- a/Crabtree/ON/Application.cs +++ b/Crabtree/ON/Application.cs @@ -1,15 +1,10 @@ 锘縰sing System; -using Android; using Android.App; using Android.Content; -using Android.Net; using Android.OS; -using Android.Views; //using CN.Jpush.Android.Api; //using CN.Jpush.Android.Service; -using Java.Lang; -using Java.Util; -using Java.Util.Zip; + using Shared; using Shared.SimpleControl; using SmartHome; @@ -184,30 +179,20 @@ ////璁剧疆鏋佸厜璋冭瘯妯″紡锛屼负false鏃跺彧鎵撳嵃璀﹀憡淇℃伅 //JPushInterface.SetDebugMode (false); //JPushInterface.Init (this);//淇濆瓨鎵嬫満鍚嶇О鍒版湰鍦版枃浠� + //鑾峰彇缁忕含搴� - Shared.Application.LocationAction = (arg1, arg2) => { - + Shared.Application.LocationAction = (lon, lat) => { try { Shared.Application.LocationAction = null; + HttpServerRequest.Current.GetCityInfo (lon.ToString (), lat.ToString ()); + //鍏抽棴瀹氫綅鏈嶅姟 Shared.Application.StopGPSLocationService (); - //Console.WriteLine ("Get Location GetAirQuality 缁忓害锛�" + arg2.ToString ()+ " 绾害锛�" +arg1.ToString ()); - - System.Threading.Tasks.Task.Run (() => { - while (true) { - try { - Shared.SimpleControl.CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality (arg2.ToString (), arg1.ToString ()); - if (Shared.SimpleControl.CommonPage.AirQuality != null) - break; - } catch { } - } - Shared.Application.RunOnMainThread (() => { - if (CommonPage.RefreshAir != null) - CommonPage.RefreshAir (); - }); - }); - } catch { + } catch (System.Exception ex) { + Utlis.WriteLine ("GetCityInfo catch" + ex.Message); } + Utlis.WriteLine ($"缁忕含搴�:::{lon}:{lat}"); }; + } void checkSomeInfo () @@ -329,6 +314,8 @@ void BusSocketStop () { IsEnterBackground = true; + //杩涘叆鍚庡彴mqtt姝e湪杩炴帴閲嶇疆鐘舵�� + MqttCommon.remoteMqttIsConnecting = false; Shared.BusSocket.Stop (); closeTime = DateTime.Now; } -- Gitblit v1.8.0