示例#1
0
 public static ErrorReport ConvertErrorReport(AndroidJavaObject errorReport)
 {
     if (errorReport == null)
     {
         return(null);
     }
     try
     {
         var id         = errorReport.Call <string>("getId");
         var threadName = errorReport.Call <string>("getThreadName");
         var startTime  = JavaDateHelper.DateTimeConvert(errorReport.Call <AndroidJavaObject>("getAppStartTime"));
         var errorTime  = JavaDateHelper.DateTimeConvert(errorReport.Call <AndroidJavaObject>("getAppErrorTime"));
         var exception  = ConvertException(errorReport.Call <string>("getStackTrace"));
         var device     = ConvertDevice(errorReport.Call <AndroidJavaObject>("getDevice"));
         return(new ErrorReport(id, startTime, errorTime, exception, device, threadName));
     }
     catch (System.Exception e)
     {
         Debug.LogErrorFormat("Failed to convert error report Java object to .Net object: {0}", e.ToString());
         return(null);
     }
 }
 public static void SetDate(AndroidJavaObject properties, string key, DateTime val)
 {
     properties.Call <AndroidJavaObject>("set", key, JavaDateHelper.DateTimeConvert(val));
 }
        public static void SetEventProperty(AndroidJavaObject propertyConfigurator, string key, DateTime value)
        {
            var javaDate = JavaDateHelper.DateTimeConvert(value);

            propertyConfigurator.Call("setEventProperty", key, javaDate);
        }