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

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

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