private Battery() { #if __IOS__ _device = UIKit.UIDevice.CurrentDevice; if (_device.Model == "iPhone Simulator") { _isSimulator = true; } #endif }
static PowerManager() { #if __IOS__ _device = UIKit.UIDevice.CurrentDevice; if (_device.Model == "iPhone Simulator") { _isSimulator = true; } else { _device.BatteryMonitoringEnabled = true; } #elif __ANDROID__ _batteryManager = (BatteryManager)Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity.GetSystemService(Context.BatteryService); #elif WINDOWS_APP //check for 10 _type10 = Type.GetType("Windows.System.Power.PowerManager, Windows, ContentType=WindowsRuntime"); #endif }