示例#1
0
文件: UMSApi.cs 项目: barneyzhu/razor
 /*run this function when app start
  *appkey:the only id of your app
  * url:your web service base url
  * */
 public static void onAppStart(string appKey,string url)
 {
     if (isAppkeyValid(appKey))
     {
         Constants.BASEURL = url;
         UmsManager.appkey = appKey;
         umsManager.init();
         registerEvent();
         manager = new DataManager(appKey);
         device_resolution = Utility.getResolution();
         new Thread(new ThreadStart(postClientData)).Start();
         new Thread(new ThreadStart(postAllData)).Start();
     }
 }
示例#2
0
 /*run this function when app start
  *appkey:the only id of your app
  * url:your web service base url
  * */
 public static void onAppStart(string appKey,string url)
 {
     
     if (isAppkeyValid(appKey))
     {
         Constants.BASEURL = url;
         UmsManager.appkey = appKey;
         umsManager.init();
         registerEvent();
         manager = new DataManager(appKey);
         device_resolution = Utility.getResolution();
         isValidKey = true;
         
     }
     
 }
示例#3
0
        public void onPageEnd(string pagename)
        {
            if (pageDictionary != null && pageDictionary.ContainsKey(pagename))
            {
                long t1 = (long)this.pageDictionary[pagename];
                long duration = (long)Math.Ceiling((double)(((double)(DateTime.Now.Ticks - t1)) / 10000.0));

                //DebugTool.Log(pagename + " duration:" + duration);
                AllModel model = new AllModel(UmsManager.appkey);
                PageInfo pageInfo = new PageInfo();
                pageInfo.appkey = UmsManager.appkey;
                pageInfo.duration = duration.ToString();
                pageInfo.end_millis = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                pageInfo.start_millis = pageDictionary[pagename+"starttime"].ToString();
                pageInfo.version = Utility.getApplicationVersion();
                pageInfo.activities = pagename;
                pageInfo.session_id = UMS_SESSION_ID;
                pageInfo.version = Utility.getApplicationVersion();
                DataManager ma = new DataManager(UmsManager.appkey);
                ma.appkey = UmsManager.appkey;
                ma.pageInfoDataProceed(pageInfo);
                
            }
        }