Android Tutorial Android Wifi-Direct Tutorial

camolas

Member
Licensed User
Longtime User
Hi,

After whe get the devices peered on first connection and then exit the app and leave one app in one device runing can i connect the sockets by only press on connect button of one device only?
In my case i whave to press on the connect buttons !?
Thanks
 

camolas

Member
Licensed User
Longtime User
You need to first click on the discover button.

On both devices?! dont work for me
I need to connect both devicess automatically.
Example: Tablet and phone

1 - discover on both devices
2 - connect on both devices and "send hello...." every thing works fine
3 - disconnect phone (tablet still runing app)
4 - Now the problem is there way to connect phone to tablet without have to press any button on tablet side?

Thanks
 

camolas

Member
Licensed User
Longtime User
Thanks Erel,

Im using the hotspot solution but some times my wifi gets crazy and cant connect to any wifi dont now if is from my app or phone.... and every time i connect to tablet hotspot it creats a new connection name in wifi avaible list... a lot with same name dont now if his this that put wifi crazy....
 

almontgreen

Active Member
Licensed User
Longtime User
I haven't tested it with multiple devices, however I expect the connection process to work correctly. However once connected you will still need to manage a Socket between each device.
Where can I find more information about this with perhaps some sample code? I've just started messing about with AsyncStreamsObject and it works great between two devices... but I have 6 that need to communicate. Yikes! I'm in over my head right now...
 

tunde

Member
Licensed User
t


The WifiDirect library is not working for me,i used the code in the wifidirect example.zip
my phone keeps displaying searching for devices for hours without discovering anything,my phone wifi was on but no good result
pls could you help with this heart breaking problem.my phone is samsung DUOS,Android 4.1.2
 

tunde

Member
Licensed User
Are you running the app on two devices? Have you clicked on Discover button on both of them?

Thanks Erel,
Yes I did ,i used two Phones and they are both Samsung and i also tried to peer with a Wifi Module still no result.I was able to scan for Wifi Devices using
ABwifi library but i dont know how to use the Library in connecting with a particular Wifi SSID.This would have been my second option because it scans and displays the available Wifi SSIDS.pls your help is needed and am also running out of Time with my project
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Worked in less than 5 minutes..
Samsong DUOS / LG G Stylus ---> worked fine then...
(some time) one of the devices stuck in "Trying to connect...." .. but astonishingly it can receive the hello msg from the other
device, but the "Send hello Message..." is grayed out and I can't send.

I disabled the WiFi and used tethering.. I can browse the net on the other device but the WiFiDirect doesn't work at all.. it can not discover the other device.

 
Last edited:

fokkate

New Member
I have downloaded the zip file and found out that there is no java file . and i just saw .b4a and .b4s files. How can I get access to the project?
 

Attachments

  • 2016-02-29 (2).png
    13.1 KB · Views: 440

clydebamford

Member
Licensed User
Longtime User
I have wifi direct working quite well but i get a timed request to "accept" or "cancel", is this android or b4a, im trying to connect without user intervention and this breaks it for me.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…