Java Question Initializing WifiP2pManager

Nenad Trickovic

Member
Licensed User
Longtime User
I need to initialize WifiP2pManager in library.

Is this right way to do this


B4X:
private String EventName;
private BA ba;

public void Initialize(final BA ba, String EventName) {
    this.EventName=EventName; this.ba=ba;
    manager = (WifiP2pManager) ba.context.getSystemService(Context.WIFI_P2P_SERVICE);
    channel = manager.initialize(ba.context, BA.handler.getLooper(), null);
  
    }
 

Nenad Trickovic

Member
Licensed User
Longtime User
Hi Erel,

WiFiDirect library works fine, I have tested it thoroughly.

I am trying to implement WiFiDirect library which handles service adding and discovery. This library is based on WiFiServiceDiscovery from Android samples.

Although all handlers return success I am not able to discover service. It looks like addLocalService does not do the job as it is not possible to discover service even using third party tool like Bonjour Discover.
 
Top