| | |
| | | using System; |
| | | using Android; |
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.Content.PM; |
| | | using Android.Net; |
| | | using Android.OS; |
| | | using Android.Support.V4.App; |
| | | using Android.Support.V4.Content; |
| | | using CN.Jpush.Android.Api; |
| | | //using Android.Widget; |
| | | using Com.Hdl.ON.Jpush.Androidjpush; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void Permissions() |
| | | { |
| | | string[] mPermissionList = new string[] |
| | | { |
| | | Manifest.Permission.ReadSms |
| | | }; |
| | | |
| | | foreach (string permissions in mPermissionList) |
| | | { |
| | | if (ContextCompat.CheckSelfPermission(this, permissions) != 0) |
| | | { |
| | | ActivityCompat.RequestPermissions(this, new string[] { permissions }, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | void initOhterSdk() |
| | | { |
| | | //注册未处理异常事件 |
| | |
| | | //#endif |
| | | JPushInterface.Init(this); |
| | | |
| | | //Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "316a8f5d83"); |
| | | |
| | | |
| | | Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "316a8f5d83"); |
| | | |
| | | |
| | | BaseActivity.OnCreateActoin += (activity, application) => |
| | | { |
| | |
| | | HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider"); |
| | | |
| | | //Shared.Application.IsGpsEnable = true; |
| | | bool isfirst = true; |
| | | //bool isfirst = true; |
| | | |
| | | |
| | | |
| | | //获取经纬度 |
| | | Shared.Application.LocationAction = (lon, lat) => |
| | | { |
| | | try |
| | | { |
| | | |
| | | if (isfirst) |
| | | { |
| | | //只触发一次 |
| | | //Shared.Application.LocationAction = null; |
| | | new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(lon.ToString().Replace(",", "."), lat.ToString().Replace(",", ".")); |
| | | } |
| | | isfirst = false; |
| | | //if (isfirst) |
| | | //{ |
| | | // //只触发一次 |
| | | // //Shared.Application.LocationAction = null; |
| | | // new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(lon.ToString().Replace(",", "."), lat.ToString().Replace(",", ".")); |
| | | //} |
| | | //isfirst = false; |
| | | ///监听经纬度 |
| | | HDL_ON.UI.UI2.Intelligence.Automation.LogicMethod.Current.AppLatAndLonEvent(lon, lat); |
| | | //关闭定位服务 |
| | |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |