public static TimeSpan GetUpTime() { long timeUpDeviceAndroid = JniCommonUtils.StaticCall <long>("uptimeMillis", 1, "com.library.javanativeunity.DeviceUtils"); TimeSpan time = TimeSpan.FromMilliseconds(timeUpDeviceAndroid); return(time); }
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 })); }
public static string GetLocalizeModelDevice() { return(JniCommonUtils.StaticCall <string>("getDeviceName", "Null", "com.library.javanativeunity.DeviceUtils")); }
public static float GetCpuTemperature() { return(JniCommonUtils.StaticCall <float>("getCpuTemperature", 0, "com.library.javanativeunity.DeviceUtils")); }
public static double GetUsedMemory() { return(JniCommonUtils.StaticCall <double>("getUsedMemory", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication })); }
public static int GetVolumeDevice() { { return(JniCommonUtils.StaticCall <int>("getVolumeDevice", 0, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication })); } }
public static long GetMemorySizeInBytes() { long a = 0; return(JniCommonUtils.StaticCall <long>("getMemorySizeInBytes", a, "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication })); }
public static bool IsPowerSaveMode() { return(JniCommonUtils.StaticCall <bool>("isPowerSaveModeEnabled", false, "com.library.javanativeunity.DeviceUtils")); }
public static string GetNetworkCarrierName() { return(JniCommonUtils.StaticCall <string>("getNetworkCarrierName", "Can't get network carier name", "com.library.javanativeunity.DeviceUtils", new object[] { JniCommonUtils.AndroidApplication })); }