| | |
| | | ## ControlIn |
| | | |
| | | 极光推送 |
| | | Key:782f3eae4e52dab57c6dfdcc |
| | | Secert:02e1d515612ea44b87952b84 |
| | | |
| | | |
| | | |
| | |
| | | //设置极光调试模式,为false时只打印警告信息 |
| | | JPushInterface.SetDebugMode (false); |
| | | JPushInterface.Init (this);//保存手机名称到本地文件 |
| | | //获取经纬度 |
| | | //获取经纬度 |
| | | MainPage.AirQuality = new AirQuality (); |
| | | Shared.Application.LocationAction = (arg1, arg2) => { |
| | | Shared.Application.LocationAction = null; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2020052801" android:versionName="2.505281" package="com.hdl.in"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2020060101" android:versionName="2.506011" package="com.hdl.in"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> |
| | | <!--Ezviz 权限 --> |
| | | <uses-permission android:name="android.permission.FLASHLIGHT" /> |
| | |
| | | <activity android:name="cn.jpush.android.ui.PopWinActivity" android:exported="false" /> |
| | | <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false" /> |
| | | <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" /> |
| | | <meta-data android:name="JPUSH_APPKEY" android:value="bcb35a1721fb9edfe9756329" /> |
| | | <meta-data android:name="JPUSH_APPKEY" android:value="782f3eae4e52dab57c6dfdcc" /> |
| | | <!-- 极光 --> |
| | | <!-- 自动更新 --> |
| | | <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.in.fileProvider" android:grantUriPermissions="true" android:exported="false"> |
| | |
| | | |
| | |
|
| | | |
| | | public class FindCityObj |
| | | { |
| | | /// <summary> |
| | | /// 城市ID |
| | | /// </summary> |
| | | public string Cid; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Location; |
| | | |
| | | /// <summary> |
| | | /// 城市 |
| | | /// </summary> |
| | | public string City; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Province; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Country; |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string TimeZone; |
| | | } |
| | | |
| | | public class GetWeatherObj |
| | | { |
| | | |
| | | |
| | | public string Temperature; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Humidity; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string PM25; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Weather; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 提交极光推送ID |
| | | /// </summary> |
| | | public class AddRegIDObj |
| | | { |
| | | public string RegID; |
| | | public string Alias; |
| | | public string Account; |
| | | /// <summary> |
| | | /// 推送APP标识 |
| | | /// 0 HDL ON |
| | | /// 1 ZigBee |
| | | /// 2 Control In |
| | | /// </summary> |
| | | public int UserMode; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 提交刷新网关远程连接密码 |
| | | /// </summary> |
| | | public class UpdateRemoteSwitchPasswordObj |
| | | { |
| | | public string Token; |
| | | public string MAC; |
| | | public string Password; |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | |
| | | public static string sendTime = ""; |
| | | public static string recTime = ""; |
| | | #if wallon |
| | | public static string CodeIDString = "202005281"; |
| | | public static string CodeIDString = "202006011"; |
| | | #else |
| | | public static string CodeIDString = "2.505281"; |
| | | public static string CodeIDString = "2.506011"; |
| | | #endif |
| | | public static UserInfo LoginUser; |
| | | public static string RequestSource = "1"; //0:Zigbee、1:HdlOn、2:GraphicsMonitor、3:BusproSoft、4:AgentWeb |
| | |
| | | } |
| | | } |
| | | |
| | | static Button btnTipMsg = new Button () { |
| | | Height = Application.GetRealHeight (126), BackgroundColor = SkinStyle.Current.AddTipButtonColor, |
| | | Y = Application.GetRealHeight(30), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | static Button btnTipMsg; |
| | | |
| | | public static void AddTip (string tip, int time = 3000) |
| | | { |
| | | |
| | | if (MainFrameLayout == null) { |
| | | return; |
| | | } |
| | | Application.RunOnMainThread (() => { |
| | | btnTipMsg.Text = tip; |
| | | MainFrameLayout.AddChidren (btnTipMsg); |
| | | btnTipMsg.MouseUpEventHandler += (sender, e) => { |
| | | if (btnTipMsg.Parent != null) |
| | | btnTipMsg.RemoveFromParent (); |
| | | }; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | System.Threading.Thread.Sleep (time); |
| | | Application.RunOnMainThread (() => { |
| | | try { |
| | | if (btnTipMsg == null) { |
| | | btnTipMsg = new Button () { |
| | | Height = Application.GetRealHeight (90), |
| | | BackgroundColor = SkinStyle.Current.AddTipButtonColor, |
| | | Y = Application.GetRealHeight (36), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | } |
| | | |
| | | btnTipMsg.Text = tip; |
| | | MainFrameLayout.AddChidren (btnTipMsg); |
| | | btnTipMsg.MouseUpEventHandler += (sender, e) => { |
| | | if (btnTipMsg.Parent != null) |
| | | btnTipMsg.RemoveFromParent (); |
| | | }; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | System.Threading.Thread.Sleep (time); |
| | | Application.RunOnMainThread (() => { |
| | | if (btnTipMsg.Parent != null) |
| | | btnTipMsg.RemoveFromParent (); |
| | | }); |
| | | }); |
| | | }); |
| | | } catch { } |
| | | }); |
| | | } |
| | | |
| | | //static Button btnTipMsg = new Button () { |
| | | // Height = Application.GetRealHeight (126), BackgroundColor = SkinStyle.Current.AddTipButtonColor, |
| | | // Y = Application.GetRealHeight(30), |
| | | // TextAlignment = TextAlignment.Center, |
| | | //}; |
| | | |
| | | //public static void AddTip (string tip, int time = 3000) |
| | | //{ |
| | | // if (MainFrameLayout == null) { |
| | | // return; |
| | | // } |
| | | // Application.RunOnMainThread (() => { |
| | | // btnTipMsg.Text = tip; |
| | | // MainFrameLayout.AddChidren (btnTipMsg); |
| | | // btnTipMsg.MouseUpEventHandler += (sender, e) => { |
| | | // if (btnTipMsg.Parent != null) |
| | | // btnTipMsg.RemoveFromParent (); |
| | | // }; |
| | | // System.Threading.Tasks.Task.Run (() => { |
| | | // System.Threading.Thread.Sleep (time); |
| | | // Application.RunOnMainThread (() => { |
| | | // if (btnTipMsg.Parent != null) |
| | | // btnTipMsg.RemoveFromParent (); |
| | | // }); |
| | | // }); |
| | | // }); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 请求服务器方法 |
| | | /// 指定一个Url,和请求方法,数据,Cookie,得到响应的数据 |
| | |
| | | Text = account, |
| | | }; |
| | | #if DEBUG |
| | | etAccount.Text = "751083166@qq.com"; |
| | | etAccount.Text = "2791308028@qq.com"; |
| | | //etAccount.Text = "751083166@qq.com"; |
| | | //etAccount.Text = "18520468203"; |
| | | //etAccount.Text = "13585007789-debug"; |
| | | //etAccount.Text = "balina3ban72-debug@gmail.com"; |
| | |
| | | Text = password, |
| | | }; |
| | | #if DEBUG |
| | | etPasswrod.Text = "85521566"; |
| | | etPasswrod.Text = "123456"; |
| | | #endif |
| | | passwrodView.AddChidren (etPasswrod); |
| | | |
| | |
| | | string DeviceType = "android"; |
| | | #if __IOS__ |
| | | DeviceType = "iphone"; |
| | | |
| | | |
| | | #endif |
| | | string jsonString = "{" + |
| | | "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | "\"Account\":" + "\"" + account + "\"" + |
| | | "}"; |
| | | MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | var mAddRegIDObj = new AddRegIDObj () { |
| | | RegID = UserConfig.Instance.tokenID, |
| | | Alias = UserConfig.Instance.phoneName, |
| | | Account = account, |
| | | UserMode = 2, |
| | | }; |
| | | var mAddRegIDObjJson = Newtonsoft.Json.JsonConvert.SerializeObject (mAddRegIDObj); |
| | | MainPage.RequestHttps (@"AddRegID", mAddRegIDObjJson, true, false); |
| | | |
| | | |
| | | //string jsonString = "{" + |
| | | // "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | // "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | // "\"Account\":" + "\"" + account + "\"" + |
| | | // "}"; |
| | | //MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | |
| | | #if wallon |
| | | #else |
| | |
| | | #if __IOS__ |
| | | DeviceType = "iphone"; |
| | | #endif |
| | | string jsonString = "{" + |
| | | "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | "\"Account\":" + "\"" + account + "\"" + |
| | | "}"; |
| | | MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | var mAddRegIDObj = new AddRegIDObj () { |
| | | RegID = UserConfig.Instance.tokenID, |
| | | Alias = UserConfig.Instance.phoneName, |
| | | Account = account, |
| | | UserMode = 2, |
| | | }; |
| | | var mAddRegIDObjJson = Newtonsoft.Json.JsonConvert.SerializeObject (mAddRegIDObj); |
| | | MainPage.RequestHttps (@"AddRegID", mAddRegIDObjJson, true, false); |
| | | |
| | | //string jsonString = "{" + |
| | | // "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | // "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | // "\"Account\":" + "\"" + account + "\"" + |
| | | // "}"; |
| | | //MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | #if wallon |
| | | #else |
| | | if (!string.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) { |
| | |
| | | #if __IOS__ |
| | | DeviceType = "iphone"; |
| | | #endif |
| | | string jsonString = "{" + |
| | | "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | "\"Account\":" + "\"" + account + "\"" + |
| | | "}"; |
| | | MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | var mAddRegIDObj = new AddRegIDObj () { |
| | | RegID = UserConfig.Instance.tokenID, |
| | | Alias = UserConfig.Instance.phoneName, |
| | | Account = account, |
| | | UserMode = 2, |
| | | }; |
| | | var mAddRegIDObjJson = Newtonsoft.Json.JsonConvert.SerializeObject (mAddRegIDObj); |
| | | MainPage.RequestHttps (@"AddRegID", mAddRegIDObjJson, true, false); |
| | | |
| | | //string jsonString = "{" + |
| | | // "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | // "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | // "\"Account\":" + "\"" + account + "\"" + |
| | | // "}"; |
| | | //MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | #if wallon |
| | | #else |
| | | if (!string.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) { |
| | |
| | | #if __IOS__ |
| | | DeviceType = "iphone"; |
| | | #endif |
| | | string jsonString = "{" + |
| | | "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | "\"Account\":" + "\"" + MainPage.LoginUser.AccountString + "\"" + |
| | | "}"; |
| | | MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | var mAddRegIDObj = new AddRegIDObj () { |
| | | RegID = UserConfig.Instance.tokenID, |
| | | Alias = UserConfig.Instance.phoneName, |
| | | Account = MainPage.LoginUser.AccountString, |
| | | UserMode = 2, |
| | | }; |
| | | var mAddRegIDObjJson = Newtonsoft.Json.JsonConvert.SerializeObject (mAddRegIDObj); |
| | | MainPage.RequestHttps (@"AddRegID", mAddRegIDObjJson, true, false); |
| | | |
| | | //string jsonString = "{" + |
| | | // "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," + |
| | | // "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," + |
| | | // "\"Account\":" + "\"" + MainPage.LoginUser.AccountString + "\"" + |
| | | // "}"; |
| | | //MainPage.RequestHttps (@"AddRegID", jsonString, true); |
| | | |
| | | if (!string.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) { |
| | | //可视对讲 |