| | |
| | | using 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; |
| | |
| | | ////设置极光调试模式,为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 { } |
| | | } catch (System.Exception ex) { |
| | | Utlis.WriteLine ("GetCityInfo catch" + ex.Message); |
| | | } |
| | | Shared.Application.RunOnMainThread (() => { |
| | | if (CommonPage.RefreshAir != null) |
| | | CommonPage.RefreshAir (); |
| | | }); |
| | | }); |
| | | } catch { |
| | | } |
| | | Utlis.WriteLine ($"经纬度:::{lon}:{lat}"); |
| | | }; |
| | | |
| | | } |
| | | |
| | | void checkSomeInfo () |