Since Android 10 and later 192.168.43.1 is no longer the default IP address of devices serving as a mobile hotspot. Instead it is randomised, seemingly like 192.168.abc.def, so if you want to use B4ABridge via this local hotspot you need to know the actual IP address to use instead of assuming 192.168.43.1.
The following Java getIpAddress() method will return a string of newline separated IP addresses for the device. When normally connected to WiFi it will have just a single IP address but when acting as a hotspot it will have two. One that is the connection to the WiFi network and one that is its address on the hotspot network. If it is not connected to a local network but is acting as a hotspot it will have just its own hotspot address which as Erel notes above B4ABridge will not see so you can use this code to find it.
Sub Button1_Click
Dim jo As JavaObject
jo.InitializeContext
MsgboxAsync(jo.RunMethod("getIpAddress", Null), "IP Adresses")
End Sub
#if java
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.net.InetAddress;
public String getIpAddress() {
String ip = "";
try {
Enumeration<NetworkInterface> enumNetworkInterfaces = NetworkInterface.getNetworkInterfaces();
while (enumNetworkInterfaces.hasMoreElements()) {
NetworkInterface networkInterface = enumNetworkInterfaces.nextElement();
Enumeration<InetAddress> enumInetAddress = networkInterface.getInetAddresses();
while (enumInetAddress.hasMoreElements()) {
InetAddress inetAddress = enumInetAddress.nextElement();
if (inetAddress.isSiteLocalAddress()) {
ip += inetAddress.getHostAddress() + "\n";
}
}
}
} catch (Exception e) {
ip += "Something Wrong! " + e.toString() + "\n";
}
return ip;
}
#End If