Android Question [B4A] Wifi Direct Tutorial

mading1309

Member
Licensed User
Longtime User
I have tried this example Android Wifi Direct tutorial.
I am using a mobile phone P30, Huawei and a mobile phone P40, Huawei

The P40 runs the example in remote mode, without connection to the PC
The P30 runs the example in debug mode, bridge connected to the PC

I clicked on ‘Discover’ on both mobile phones and received the message ‘Peered Devices : 0’.
If I stop the programme flow for the P30, the return for SUCCESS is false.

Both mobile phones support WiFi direct
Both mobile phones are in the same WiFi connected

Does anyone have any idea what the problem is?
 

teddybear

Well-Known Member
Licensed User
Wi-Fi Direct is called Wi-Fi P2P, it is not related to whether both phones have connected to the same WiFi.

Try adding the permissions for your phones

B4X:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.INTERNET
 
Last edited:
Upvote 0

mading1309

Member
Licensed User
Longtime User
Wi-Fi Direct is called Wi-Fi P2P, it is not related to whether both phones have connected to the same WiFi.

Try adding the permissions for your phones

B4X:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.INTERNET
Thank you for the hint. Check and adjust the permissions. Share my experiences and results with on Monday
 
Upvote 0
Top