B4A Code Snippet WifiNetworkSpecifier + NetworkRequest - connect app to specific wifi network - Erel    Oct 5, 2025   (18 reactions) Requires Android 10+ (api level 29+). Allows your app to connect to a specific network, provided... will use this network. The user will need to approve the connection on the first time. Manifest editor: AddPermission("android.permission.CHANGE_NETWORK_STATE") Code (in a class module such as B4XMainPage): Private Sub ConnectToNetwork (SSID As String, Password As String, TimeoutMs....net.wifi.WifiNetworkSpecifier.Builder", Null) builder.RunMethod("setSsid", Array... B4J Tutorial AsyncStreamsObject - Send and receive objects over the network - Erel    Aug 10, 2016   (8 reactions)   tags: Network For new projects it is recommended to use B4XSerializator instead of this solution. http://www.b4x.com/basic4android/images/SS-2013-11-14_13.26.52.png AsyncStreamsObject allows you to send and receive objects instead of bytes. You can read more about it here: http://www.b4x.com/android/forum/threads/asyncstreamsobject-send-and-receive-objects-instead-of-bytes.30543/ This example connects to t... B4A Code Snippet Workaround the NetworkOnMainThread exception - Erel    Apr 10, 2025   (24 reactions) Android 4+ doesn't allow applications to make network calls on the main thread. There is a good reason for this restriction as such calls cause the UI to freeze and after 5 second Android will show the "Application not responding" dialog. Proper libraries take care of handling network calls with background threads. If you encounter a library that doesn't do it then you have two...: NetworkOnMainThreadException, strict mode... B4A Code Snippet [B4X] Find all reachable ips in the local network - Erel    Mar 12, 2025   (20 reactions) Slightly based on: https://stackoverflow.com/questions/16035636/how-to-get-all-ip-address-of-systems-connected-to-same-wi-fi-network-in-android/21091575#21091575 Compatible with B4A and....permission.INTERNET) Depends on (j)Network library. Code: Private Sub ScanNetwork Dim server... Then Log("Not connected to network.") Return End If Dim... maybe 3 seconds to scan the network here (and it doesn't block the main thread).... B4A Tutorial [B4X] Network + AsyncStreams + B4XSerializator - Erel    Jun 30, 2020   (27 reactions)   tags: transfer, B4XSerializator, Erel, Network Better implementation, based on B4XPages: https://www.b4x.com/android/forum/threads/b4x-b4xpages-network-asyncstreams-b4xserializator.119011/#content New video tutorial: 256762156 https://www.b4x.com/basic4android/images/SS-2016-10-19_15.32.02.jpg https://www.b4x.com/basic4android/images/SS... This is a simple and important example. It demonstrates several good practices related to network communication. 1. The network related code is in the Starter service. The network state is also stored in... B4A Tutorial B4A-Bridge over wifi without a local network - Erel    Jun 15, 2015   (9 reactions)   tags: B4A-Bridge no net Starting from B4A v5.0, B4A-Bridge over Bluetooth is no longer available. You can use B4A-Bridge over wifi or USB debug mode to connect the IDE to a device. By creating a mobile hotspot you can easily connect to a device with B4A-Bridge even if there is no local network. The steps are: 1. Start.... It will show a message saying: "Not connected to wireless network". Ignore it. 4. Set... will use the device mobile network provider to connect to the internet. This may result in large bandwidth... B4A Tutorial [B4X] [B4XPages] Network + AsyncStreams + B4XSerializator - Erel    Jun 30, 2020   (29 reactions) https://www.b4x.com/basic4android/images/java_USPawWZPiX.png 95652 https://www.b4x.com/basic4android/images/B4i_nUuTQqGuEH.png Cross platform version, based on B4XPages, of the network example: https://www.b4x.com/android/forum/threads/b4x-network-asyncstreams-b4xserializator.72149/#content It is so much simpler to use B4XPages that it feels like cheating :) All of the code is shared. The layouts were copy-pasted.... B4i Code Snippet Connect to wifi network programmatically - NEHotspotConfigurationManager - Erel    Jan 4, 2026   (4 reactions) Allows connecting to a wifi network programmatically. Note that the user will need to approve the connection if it is new. Note that error handling of this API is broken and there is no... a new one. Step 2: Add to main module: #Entitlement: <key>com.apple.developer.networking... 'Maybe there is a connection now. Make a network call to test it. End If End Sub #if OBJC #import <NetworkExtension/NetworkExtension.h> - (void)connectToWifi: (NSString*)ssid... B4i Code Snippet WiFi info with NEHotspotNetwork - Yanik Freeman    Feb 15, 2026   (2 reactions) CNCopyCurrentNetworkInfo is deprecated and will always return nil or an empty dictionary when.... This example uses the NEHotspotNetwork.fetchCurrent() method with callback instead and is backwards compatible to iOS 13+. #Entitlement: <key>com.apple.developer.networking.wifi-info</key>... End Sub #If OBJC #import <NetworkExtension/NetworkExtension.h> - (void)fetchWiFi:(NSObject*)tag { if (currentNetwork != nil) { // Signal strength is often 0 or... B4R Tutorial Ethernet / Network Tutorial - Erel    Apr 12, 2016   (5 reactions) the network.
We can assign a static address to the board or ask the network DHCP service to assign...
Log("Error connecting to network.")
Return
End If
MacAddress is a 6 bytes... Page: 1   2   3   4   5   6   7   |