本文整理自网络,侵删。
uses Androidapi.Helpers, Androidapi.JNI.GraphicsContentViewText;
procedure TForm2.Button3Click(Sender: TObject); function HasPermission(const Permission: string): Boolean; begin Result := SharedActivityContext.checkCallingOrSelfPermission(StringToJString(Permission)) = TJPackageManager.JavaClass.PERMISSION_GRANTED end;
begin // Bluetooth蓝牙通讯 if HasPermission('android.permission.BLUETOOTH') then ShowMessage('有Bluetooth的通信使用权限') else ShowMessage('没有使用蓝牙的通信权限');
// Bluetooth?O定?涓? if HasPermission('android.permission.BLUETOOTH_ADMIN') then ShowMessage('有变更蓝牙设定的权限') else ShowMessage('没有修改蓝牙设置的权限');end;
记得给蓝牙权限。
相关阅读 >>
Delphi winapi: openprocess、getexitcodeprocess、terminateprocess (qq)
Delphi 2009 中 tstrings 与 tstream 的增强
Delphi 一组数据,按由大到小进行排序,并输出最大值与最小值
更多相关阅读请进入《Delphi》频道 >>