本文整理自网络,侵删。
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的字符截取函数leftstr,midstr,rightstr的介绍以及字符串拆分
Delphi xe5开发android程序调用电话相关功能(短信息和电话)
Delphi android实例-红外线操作(xe10.2+小米5)
Delphi xe 自己编辑xe2 vcl style(皮肤/skin)
Delphi ioutils 获取当前目录下所有的文件/文件夹
更多相关阅读请进入《Delphi》频道 >>