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

            return(time);
        }
Example #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 }));
 }
Example #3
0
 public static string GetLocalizeModelDevice()
 {
     return(JniCommonUtils.StaticCall <string>("getDeviceName", "Null", "com.library.javanativeunity.DeviceUtils"));
 }
Example #4
0
 public static float GetCpuTemperature()
 {
     return(JniCommonUtils.StaticCall <float>("getCpuTemperature", 0, "com.library.javanativeunity.DeviceUtils"));
 }
Example #5
0
 public static double GetUsedMemory()
 {
     return(JniCommonUtils.StaticCall <double>("getUsedMemory", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
 }
Example #6
0
 public static int GetVolumeDevice()
 {
     {
         return(JniCommonUtils.StaticCall <int>("getVolumeDevice", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
     }
 }
Example #7
0
        public static long GetMemorySizeInBytes()
        {
            long a = 0;

            return(JniCommonUtils.StaticCall <long>("getMemorySizeInBytes", a, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication }));
        }
Example #8
0
 public static bool IsPowerSaveMode()
 {
     return(JniCommonUtils.StaticCall <bool>("isPowerSaveModeEnabled", false, "com.library.javanativeunity.DeviceUtils"));
 }
Example #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 }));
 }