public CountlyCrashReport(string errorText)
 {
     parameters = new Dictionary<string, string>()
       {
     {"_os", ""},
     {"_os_version", ""},
     {"_manufacture", ""},
     {"_device", ""},
     {"_resolution", ""},
     {"_app_version", ""},
     {"_cpu", ""},
     {"_opengl", ""},
     {"_rem_current", ""},
     {"_ram_total", ""},
     {"_disk_current", ""},
     {"_disk_total", ""},
     {"_bat", ""},
     {"_orientation", ""},
     {"_root", ""},
     {"_online", ""},
     {"_muted", ""},
     {"_background", ""},
     {"_name", ""},
     {"_error", ""},
     {"_nonfatal", ""},
     {"_logs", ""},
     {"_run", ""}
       };
       DeviceInfo info = new DeviceInfo();
       info.Update();
       parameters["_os"] = info.OSName;
       parameters["_os_version"] = info.OSVersion;
       parameters["_app_version"] = CountlyManager.Instance.appVersion;
       parameters["_error"] = errorText;
       parameters["_online"] = Application.internetReachability.ToString();
       parameters["_opengl"] = SystemInfo.graphicsDeviceVersion;
       parameters["_cpu"] = SystemInfo.processorType;
       parameters["_device"] = info.Device.ToString();
       parameters["_resolution"] = info.Resolution;
       parameters["_ram_total"] = SystemInfo.systemMemorySize.ToString();
       parameters["_run"] = Time.realtimeSinceStartup.ToString();
       custom = new Dictionary<string, string>();
 }
 public MetricsClass(DeviceInfo info)
 {
     _device = info.DeviceName;
     _os = info.OS;
     _os_version = info.OSVersion;
     _carrier = info.Carrier;
     _resolution = info.Resulution;
     _local = info.Local;
     _app_version = info.AppVersion;
 }
Exemplo n.º 3
0
        protected StringBuilder InitConnectionData(DeviceInfo info)
        {
            StringBuilder builder = InitConnectionDataStringBuilder();

              builder.Append("app_key=");
              AppendConnectionData(builder, appKey);

              builder.Append("&device_id=");
              AppendConnectionData(builder, info.UDID);

              builder.Append("&timestamp=");

              long timestamp = (long)Utils.GetCurrentTime();
              builder.Append(timestamp);

              return builder;
        }
Exemplo n.º 4
0
 protected DeviceInfo UpdateDeviceInfo()
 {
     try {
     if (_deviceInfo == null) {
         _deviceInfo = new DeviceInfo();
     }
     _deviceInfo.Update();
     Log ("Succesfully updated device info");
     return _deviceInfo;
     } catch(System.Exception ex) {
     Log ("Error during obtaining device info: " + ex.StackTrace.ToString());
     }
      return null;
 }
Exemplo n.º 5
0
        public void endSession(int duration)
        {
            string data;

            data  = "app_key=" + AppKey;
            data += "&" + "device_id=" + DeviceInfo.getUDID();
            data += "&" + "end_session=" + "1";
            data += "&" + "session_duration=" + duration;

            queue.Enqueue(data);
            Tick();

            //ManualResetEvent Restart = new ManualResetEvent(false);

            //ThreadPool.QueueUserWorkItem((o) =>
            //    {
            //        HttpWebRequest Request = WebRequest.CreateHttp(ServerURL + "/i?" + data);

            //        Request.BeginGetResponse(new AsyncCallback((Async) =>
            //            {
            //                HttpWebResponse Responce = (HttpWebResponse)((HttpWebRequest)Async.AsyncState).EndGetResponse(Async);
            //                String s = (new StreamReader(Responce.GetResponseStream())).ReadToEnd();
            //                Restart.Set();
            //            }), Request);
            //    });
            //Restart.WaitOne();

            //Tick();
            //thread.Join();

            /*
             * StopThread = true;
             * if (null != thread && ThreadState.Unstarted != thread.ThreadState)
             * {
             *  thread.Join();
             * }
             *
             * ManualResetEvent Continue = new ManualResetEvent(false);
             *
             * foreach (String CurrentQuery in queue)
             * {
             *  try
             *  {
             *      WebClient Downloader = new WebClient();
             *      Downloader.OpenReadCompleted += new OpenReadCompletedEventHandler((object sender, OpenReadCompletedEventArgs args) =>
             *          {
             *              try
             *              {
             *                  if (null != args.Error)
             *                  {
             *                      throw args.Error;
             *                  }
             *
             #if (DEBUG)
             *                  Debug.WriteLine("Countly:\t" + "ok -> " + CurrentQuery);
             #endif
             *              }
             *              catch (Exception E)
             *              {
             *              }
             *              finally
             *              {
             *                  if (null != args.Result)
             *                  {
             *                      args.Result.Close();
             *                  }
             *
             *                  Continue.Set();
             *              }
             *          });
             *      Downloader.OpenReadAsync(new Uri(ServerURL + "/i?" + CurrentQuery, UriKind.Absolute));
             *      Continue.WaitOne();
             *  }
             *  catch (Exception E)
             *  {
             #if (DEBUG)
             #endif
             *  }
             *  finally
             *  {
             *      Continue.Reset();
             *  }
             * }
             */
        }