Jump to content
GSan

How can enable HotSpot on android 11 device by delphi code

Recommended Posts

Hi everyone, I'm trying to enable and disable hotspot on android11 device with Delhpi 11 but I don't understand what I'm doing wrong....

this is my code:
procedure TForm1.Button2Click(Sender: TObject);
var
WifiManagerObj: JObject;
WifiManager: JWifiManager;
Mycallback: JWifiManager_LocalOnlyHotspotCallback;
 startedres:JWifiManager_LocalOnlyHotspotReservation;
handler: JHandler;
begin

 WifiManagerObj := SharedActivityContext.getSystemService(TJContext.JavaClass.WIFI_SERVICE);
 WifiManager := TJWifiManager.Wrap((WifiManagerObj as ILocalObject).GetObjectID);


Mycallback:= TJWifiManager_LocalOnlyHotspotCallback.Create;
 startedres:=TJWifiManager_LocalOnlyHotspotReservation.Create;

  WifiManager.startLocalOnlyHotspot(Mycallback,handler);

  Mycallback.onStarted(startedres);

end;
some idea...

thank you

 

GS

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×