博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
delphi IOS 获取电池信息
阅读量:7026 次
发布时间:2019-06-28

本文共 623 字,大约阅读时间需要 2 分钟。

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

转载地址:http://zzlxl.baihongyu.com/

你可能感兴趣的文章