Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWifiManager : Scan returns nothing #529

Open
HuguesDug opened this issue Jan 2, 2025 · 0 comments
Open

JWifiManager : Scan returns nothing #529

HuguesDug opened this issue Jan 2, 2025 · 0 comments

Comments

@HuguesDug
Copy link

Hello,

Here attached a bit of code that just return constantly 0 network found.

Is this component really able to scan the available wifi networks ?


procedure TAndroidModule1.AndroidModule1Show(Sender: TObject);
begin
Timer1.enabled:=true;
Textview1.Text:='';
end;

procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
begin
WifiManager.SetWifiEnabled(true);

if WifiManager.NeedWriteSettingsPermission() then
WifiManager.RequestWriteSettingsPermission();

WifiManager.init;
end;

procedure TAndroidModule1.Button1Click(Sender: TObject);
begin
AndroidModule1.Close;
end;

procedure TAndroidModule1.Timer1Timer(Sender: TObject);
Var i:Integer;
begin
TextView1.Append('Scanning...'+#13+#10);
Nets:=WifiManager.Scan;
TextView1.Append('Found '+IntToStr(Length(Nets))+#13+#10);
For i:=low(Nets) to High(Nets) do
begin
TextView1.Append(Nets[i]+#13+#10);
TextView1.Append(WifiManager.GetCapabilities(i)+#13+#10);
end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant