procedure TDeviceInfoForm.btnGetDeviceInfoClick(Sender: TObject); var Device : UIDevice; begin Device := TUIDevice.Wrap(TUIDevice.OCClass.currentDevice); lbOSName.Text := Format('OS Name: %s', [NSStrToStr(Device.systemName)]); lbOSVersion.Text := Format('OS Version: %s', [NSStrToStr(Device.systemVersion)]); lbDeviceType.Text := Format('Device Type: %s', [NSStrToStr(Device.model)]); //code added for detecting battery level Device.setBatteryMonitoringEnabled(True); lblBatteryLevel.Text := Format ('Battery Level: %d', [Round(Device.batteryLevel*100)]); end;
https://community.embarcadero.com/blogs?view=entry&id=9356