HDL Home App 第二版本 旧平台金堂用 正在使用
lss
2022-04-26 5777c367f53c758546211d5f7f40a27f0b11c660
ZigbeeApp/GateWay.Droid/Application.cs
old mode 100755 new mode 100644
@@ -20,7 +20,6 @@
namespace com.hdl.home
{
    [Activity(Name = "com.hdl.home.wxapi.WXEntryActivity", Exported = true, Theme = "@android:style/Theme.Translucent", LaunchMode = Android.Content.PM.LaunchMode.SingleTask)]
    class WXEntryActivity : Android.App.Activity, IWXAPIEventHandler
    {
@@ -83,6 +82,12 @@
    public class Application : Android.App.Application
    {
        public Application(IntPtr handle, Android.Runtime.JniHandleOwnership ownerShip) : base(handle, ownerShip) { }
        /// <summary>
        /// 检测内存泄露的东西
        /// </summary>
        //private Square.LeakCanary.RefWatcher _refWatcher;
        public override void OnCreate()
        {
            //如果不是App的主进程,则不需要处理
@@ -101,9 +106,16 @@
                //调试:记录系统异常
                Shared.Phone.UserCenter.HdlLogLogic.Current.WriteOtherText(Shared.Phone.UserCenter.DirNameResourse.SystemLogFile, ex.Message + "\r\n" + ex.StackTrace, true, false);
            }
            base.OnCreate();
            // 通过WXAPIFactory工厂,获取IWXAPI的实例
            //api = WXAPIFactory.CreateWXAPI(this, "wx2ec8f53f6fa36e82", true);
            base.OnCreate();
            // 通过WXAPIFactory工厂,获取IWXAPI的实例
            //api = WXAPIFactory.CreateWXAPI(this, "wx2ec8f53f6fa36e82", true);
            //检测内存泄露的东西
            //if (Square.LeakCanary.LeakCanaryXamarin.IsInAnalyzerProcess(this) == false)
            //{
            //    _refWatcher = Square.LeakCanary.LeakCanaryXamarin.Install(this);
            //    _refWatcher.Watch(this);
            //}
            // 将应用的appId注册到微信
            api?.RegisterApp("wx2ec8f53f6fa36e82");
@@ -136,12 +148,14 @@
            var req = new SendAuth.Req { Scope = "snsapi_userinfo", State = "ZigbeeApp" };
            api?.SendReq(req);
        }
        /// <summary>
      /// 所有初始化全部在这个方法实现
      /// </summary>
      void initAll()
        {
            Shared.Application.IsGpsEnable = System.IO.File.Exists(Shared.Phone.UserCenter.DirNameResourse.OpenGbsFile);
            //取消屏幕常亮
            BaseActivity.KeepScreenON = false;
            //隐藏底部软按键
            BaseActivity.IsHideVirualButtons = true;
@@ -462,40 +476,7 @@
        /// <param name="hiddenJson">云端推过来的数据</param>
        private void VideoMethod(string hiddenJson)
        {
            var hiddanJson = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson);
            if (hiddanJson == null)
            {
                return;
            }
            var json = Newtonsoft.Json.Linq.JObject.Parse(hiddanJson["HiddanJson"].ToString());
            if (json == null)
            {
                return;
            }
            Shared.Phone.VideoPhone.ESVideoInfo eSVideoInfo = new Shared.Phone.VideoPhone.ESVideoInfo();
            if (json["uuid"].ToString().Contains(","))
            {
                var uuid = json["uuid"].ToString().Split(',');
                eSVideoInfo.ESVideoUUID = uuid[0];
            }
            else
            {
                eSVideoInfo.ESVideoUUID = json["uuid"].ToString();
            }
            eSVideoInfo.DeviceName = Language.StringByID(Shared.R.MyInternationalizationString.theOutdoorUnit);
            eSVideoInfo.ESRoomID = int.Parse(json["roomno"].ToString());
            if (!string.IsNullOrEmpty(json["unitno"].ToString()))
            {
                string str = json["unitno"].ToString();
                string str1 = str.Substring(0, 2).TrimStart('0');
                string str2 = str.Substring(2, 2).TrimStart('0');
                eSVideoInfo.RoomName = str1 + Language.StringByID(Shared.R.MyInternationalizationString.dong) + str2 + Language.StringByID(Shared.R.MyInternationalizationString.unit);
            }
            Shared.Phone.VideoPhone.ESVideo.ShowESvideoVideoIntercom(eSVideoInfo);
            Com.Evoyohome.Sphonelibs.Global.Global.OpenCallActivity(null);
        }
    }
}