在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
uses AndroidAPI.JNI.GraphicsContentViewText, AndroidAPI.JNI.JavaTypes, AndroidAPI.JNI.OS; function BatteryPercent(const aContext: JContext): Integer; var filter: JIntentFilter; battery: JIntent; level, scale: Integer; begin filter := TJIntentFilter.Create; filter.addAction(TJIntent.JavaClass.ACTION_BATTERY_CHANGED); battery := aContext.registerReceiver(NIL, filter); level := battery.getIntExtra(StringToJString('level'), -1); scale := battery.getIntExtra(StringToJString('scale'), -1); result := (100 * level) div scale; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论