Android Tutorial Android Wifi-Direct Tutorial

antonomase

Active Member
Licensed User
Longtime User
If I look into the variable "device" with the debugger, it seems to be an object with many properties. But just name and mac address are available with getters.
 

luke2012

Well-Known Member
Licensed User
Longtime User
@Erel,
I'm trying your demo and I have only one question (until now)

The accept connection message is raised only the first time, like bluetooth paring ?
 

luke2012

Well-Known Member
Licensed User
Longtime User
@Erel,
I'm trying to understand your tutorial and it is quite clear for me, except the GroupOwnerIp parameter that is passed in the _ConnectionChanged event.

Tell me if I wrong :
1) I understand that it's the server IP. This IP is used by the client to create the socket connection.
2) GroupOwnerIp can assume loopback IP address (127.0.0.1) or other network address.

2) I don't know which is the rule that set the GroupOwnerIp IP address.
 

luke2012

Well-Known Member
Licensed User
Longtime User
1) Yes.
2) The "server" device GroupOwnerIp address will always be 127.0.0.1. The server should use a ServerSocket to accept incoming connections.

So the ServerSocket can accept multiple connections from other devices ?
 

Gaver Powers

Member
Licensed User
Longtime User
Has anyone connected to a wifi enabled arduino using this yet?
 

F.JANSEN

New Member
Licensed User
Longtime User
Dear,


how do I see the name of my ” wi-fi direct” when I establish a connection? I can only see the device name found but not mine.


Best Regards,
Jansen
 

F.JANSEN

New Member
Licensed User
Longtime User
This is the configuration of Wi-Fi Direct from my Smartphone, and enables me to rename "Jansenx".
I'm trying to get this name in my application. Is this possible?



 

F.JANSEN

New Member
Licensed User
Longtime User
Really, I did not find API that returns the name of my direct wi-fi device ... Thanks!
 

ppgirl

Member
Licensed User
Longtime User
Hi Erel,

Help , Could you develop more/detail functions for wifi direct library?

I want to create the code from follow java code . but I can not find those struct...



  1. config.wps = wps;
  2. config.deviceAddress = mConnectingDevice.deviceAddress;
  3. config.groupOwnerIntent = WifiP2pConfig.MIN_GROUP_OWNER_INTENT;
  4. ...
  5. mWifiP2pManager.connect(mWifiP2pChannel, config, new ActionListener() {
 

ppgirl

Member
Licensed User
Longtime User
Dear Erel,

I want make a wifi display app , I need set Wifi to WFD mode and wait connecting.

There is sample code , I would move to a java project for whole function if B4A can not finish it.

private WifiManager n;
private WifiP2pManager t;
private WifiP2pManager.Channel u;
private Timer g = null;
....

this.n = ((WifiManager)getSystemService("wifi"));
if (this.n != null)
Log.d("",Get WifiP2pManager instance successfully");
this.t = ((WifiP2pManager)getSystemService("wifip2p"));
if (this.t != null)
Log.d("", "Get WifiP2pManager instance successfully");
this.u = this.t.initialize(this, getMainLooper(), null);
Log.d("", "WifiP2pManager initialization started");

WifiP2pWfdInfo localWifiP2pWfdInfo = new WifiP2pWfdInfo();
localWifiP2pWfdInfo.setWfdEnabled(true);
localWifiP2pWfdInfo.setDeviceType(1);
localWifiP2pWfdInfo.setSessionAvailable(true);
localWifiP2pWfdInfo.setControlPort(554);
localWifiP2pWfdInfo.setMaxThroughput(50);
this.t.setWFDInfo(this.u, localWifiP2pWfdInfo, new g(this));

......
 

BarryW

Active Member
Licensed User
Longtime User
Can this library send a file?

Photo, mp3, video or txt file?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…