本文整理自网络,侵删。
type TForm1 = class(TForm)
function IsWifiEnabled: Boolean;
end;
uses Androidapi.Helpers, Androidapi.JNI.JavaTypes, Androidapi.JNI.GraphicsContentViewText, Androidapi.JNIBridge, Androidapi.JNI.WifiManager;
function TForm1.IsWifiEnabled: Boolean;var Obj: JObject; WifiManager: JWifiManager;begin Obj := SharedActivityContext.getSystemService (TJContext.JavaClass.WIFI_SERVICE); if Obj = nil then Exit(False); WifiManager := TJWiFiManager.Wrap((Obj as ILocalObject).GetObjectID); Result := WifiManager.isWifiEnabled;end;
相关阅读 >>
Delphi 2009 indy10 idhttp get 中文出现乱码的问题
更多相关阅读请进入《Delphi》频道 >>