Android Question Small network via WiFi direct, to access the SQLight server.

Lakhtin_V

Active Member
Licensed User
Longtime User
I can not find a working example for working with WIFI direct. All old WiFi examples and libraries do not work on new smartphones. You may need to make special entries in the manifest and comply with security requirements in new versions of android? I am a beginner and I can assume that you can’t use the B4X bridge to debug programs with Wifi direct, WiFi direct on the smartphone must be enabled but the Wi-Fi router is turned off?
 

Lakhtin_V

Active Member
Licensed User
Longtime User
I tried for example
1674802952451.png

1674803189745.png



Manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

1674803341139.png
 

Attachments

  • MLwifi400-v4.41.zip
    26 KB · Views: 168
  • WifiTest.zip
    11.5 KB · Views: 159
  • 1674803221918.png
    1674803221918.png
    44.1 KB · Views: 158
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
test:
1. execute tools ->jetifier
2. comment ->'#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,....

1674821508143.png
 

Attachments

  • WifiTest2.zip
    11.5 KB · Views: 184
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
Thank you so much for the prompt response, your version of the application is running. I saw two buttons set up and reset up. I am a beginner and it is not clear to me what exactly can be observed and tested in this application. I run it through the B4X bridge over the wifi, there is a router next to it. What elementary actions can I rehearse in this application? Maybe you need to install the application on two smartphones and you can see some kind of interaction between them. Now in the log window, I saw only the name of the network that my smartphone uses. In your log, I see the origin of scanning available networks, but I don’t have it.
My main goal is to organize a small network between smartphones without a router, but using direct on a smartphone.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
My main goal is to organize a small network between smartphones without a router, but using direct on a smartphone.
see example:

i have tested it on android 9 + sdk 31, it works fine.

Note:
For what you are looking for this may be the way

remember jetifier
1674839468387.png

1674839349448.png
 

Attachments

  • 1.zip
    9.1 KB · Views: 161
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
Yes! :). Thanks a lot for your specific help. But according to your example, it is not clear where to look for аdditional the WiEiDirect 1.05 library. There is no library in the archive that you sent.
 
Last edited:
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
see example:

i have tested it on android 9 + sdk 31, it works fine.

Note:
For what you are looking for this may be the way

remember jetifier
View attachment 138592
View attachment 138591
?

SQL light server = SQLite?​

I tested this version of the example. I successfully worked on smartphones SDK 4,6,7 but SDK 9 and 12 did not work. In addition, I made sure that a message on a network of 3 smartphones can only be transferred between two devices. If a third device wants to come into operation, it turns off one of the two and takes its place. More modern smartphones with SDK greater than 9 do not find devices nearby when exploring the network, what could be the reason?
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
see example:

i have tested it on android 9 + sdk 31, it works fine.

Note:
For what you are looking for this may be the way

remember jetifier
View attachment 138592
View attachment 138591

Which error do you get?
I want to get advice from the GURU. what library and what examples should i use for Wifi Direct to work? MLwifi or WiFiDirect library? Which of these options is more promising for working with WiFi Direct on SDK 9 and more?
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
I'm not familiar with MLWifi. You haven't posted any real error message...
Now the WIFI Direct example is working for me on WIFI Direct library. This example only works on older smartphones with SDK less than 9. It may be necessary to somehow correct the manifest or manage permissions for new versions of android. On new versions of androyd, the error does not occur, the device cannot establish a connection - 0 peered device. Therefore, there is no formal error.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
Ever considered using the forumsearch first?

It is listed in the 1. result

A lot has been written on the forum on the topic. I carefully read the posts of this year and earlier. The main idea is that the newer the version of android, the more problems with the use and programming of WiFi Direct. I tried to test many different examples with the library WiFi Direct V1.05 on different smartphone models. But a good result was only with older versions of SDK less than 4. 6. 7. other 9 and 12 could no longer display the list of devices. Fatally, the search for devices was instantaneous and the result was 0.
 
Upvote 0
Top