Delphi XE7的Android应用设定Wifi的有效无效
2022-12-01 14:33:20 作者:admin
本文整理自网络,侵删。
type TForm1 = class(TForm) procedure SetWifiEnabled(Enabled: Boolean);
end;
uses Androidapi.Helpers, Androidapi.JNI.JavaTypes, Androidapi.JNI.GraphicsContentViewText, Androidapi.JNIBridge, Androidapi.JNI.WifiManager;
procedure TForm1.SetWifiEnabled(Enabled: Boolean);var Obj: JObject; WifiManager: JWifiManager;begin Obj := SharedActivityContext.getSystemService (TJContext.JavaClass.WIFI_SERVICE); if Obj = nil then Exit; WifiManager := TJWiFiManager.Wrap((Obj as ILocalObject).GetObjectID); WifiManager.setWifiEnabled(Enabled);end;
相关阅读 >>
Delphi listview 设置固定列宽
Delphi 如何在窗体标题栏添加按钮
Delphi uac相关代码
Delphi 如何把字符串覆给数组
Delphi 根据字符串找到函数并执行
Delphi禁止用户切换任务
Delphi 隐藏进程的单元 unit hideprocess.pas
Delphi文件 fileopen 、fileseek等的用法(看红色字体)
Delphi 通过pid获取进程名
Delphi unicode转换ansi
更多相关阅读请进入《Delphi》频道 >>
猜你喜欢
联络方式:
400-123-789
邮箱:xiachao@163.com
Q Q:12345678
微信公众号
微信二维码