How to controll Wifi device descovery process

Pavlov, Pavel 1 Reputation point
2022-12-06T09:59:27.91+00:00

Hello,
We have a custom hardware device which acts as an WIFI Access Point and we have a XamarinForms application which should connect to the device and communicate to it using TCP protocol. Now we want to automate the device discovery and device connection processes on the application side. For that we tried using Xamarin.Essentials package and its Connectivity features but it does not allow controlling the WIFI devices discovery process. It only provides you with information about the connection you may have.

So my question is, does XamarinForms provide any tools for controlling the WIFI device discovery process from the shared codebase?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 68,901 Reputation points Microsoft Vendor
    2022-12-07T06:47:11.477+00:00

    Hello,

    does XamarinForms provide any tools for controlling the WIFI device discovery process from the shared codebase?

    No, but you can write specific platform code about automate the device discovery and device connection processes. Then invoke this code by DependencyService in the shared codebase.

    For Android, you can use WifiManager to achieve it.
    For iOS, you can refer to NEHotspotConfigurationManager, but you cannot change Wi-Fi connection Without explicit user consent

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.