コード例 #1
0
        public static TimeSpan GetUpTime()
        {
            long     timeUpDeviceAndroid = JniCommonUtils.StaticCall <long>("uptimeMillis", 1, "com.library.javanativeunity.DeviceUtils");
            TimeSpan time = TimeSpan.FromMilliseconds(timeUpDeviceAndroid);

            return(time);
        }
コード例 #2
0
 public static int GetBrightness()
 {
     //We using method get from Java native. But in Unity 2019 or newer, I recommend using "Screen.brightness".
     return(JniCommonUtils.StaticCall <int>("getScreenBrightness", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
 }
コード例 #3
0
 public static string GetLocalizeModelDevice()
 {
     return(JniCommonUtils.StaticCall <string>("getDeviceName", "Null", "com.library.javanativeunity.DeviceUtils"));
 }
コード例 #4
0
 public static float GetCpuTemperature()
 {
     return(JniCommonUtils.StaticCall <float>("getCpuTemperature", 0, "com.library.javanativeunity.DeviceUtils"));
 }
コード例 #5
0
 public static double GetUsedMemory()
 {
     return(JniCommonUtils.StaticCall <double>("getUsedMemory", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
 }
コード例 #6
0
 public static int GetVolumeDevice()
 {
     {
         return(JniCommonUtils.StaticCall <int>("getVolumeDevice", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
     }
 }
コード例 #7
0
        public static long GetMemorySizeInBytes()
        {
            long a = 0;

            return(JniCommonUtils.StaticCall <long>("getMemorySizeInBytes", a, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
        }
コード例 #8
0
 public static bool IsPowerSaveMode()
 {
     return(JniCommonUtils.StaticCall <bool>("isPowerSaveModeEnabled", false, "com.library.javanativeunity.DeviceUtils"));
 }
コード例 #9
0
 public static string GetNetworkCarrierName()
 {
     return(JniCommonUtils.StaticCall <string>("getNetworkCarrierName", "Can't get network carier name", "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
 }