Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #2
for example, many different devices return the same longitude and latitude.such as : longitude is 121.474000 and latitude is 31.230001.
i donnot understand why is the data the same?
i donnot understand why is the data the same?
Description
I’m developing an Android app that intended to use Ethernet to discover BACnet devices on the local network, while Wi-Fi is used for general internet connectivity. The device has both Ethernet and Wi-Fi interfaces connected simultaneously.
Issue: When I bind my app’s process to a specific network interface (Ethernet or Wi-Fi), the network binding appears to succeed, as indicated by the logs. However, I am unable to discover BACnet devices over Ethernet after binding, when both Ethernet and Wi-Fi are active. This issue occurs on Android 12 (API level 31). The same code works on older Android versions (like Android 7) where I can successfully discover devices using either interface.
Details: App Behavior:
When only one interface (Ethernet or Wi-Fi) is active, the app successfully discovers devices on that network. When both interfaces (Ethernet and Wi-Fi) are active, I bind to the required interface using bindProcessToNetwork(). The logs show that the process is successfully bound, but the device discovery fails over Ethernet (BACnet devices are discovered but I am unable to fetch objects).
Observed Behavior:
The app logs show that the process is bound to Ethernet (TRANSPORT_ETHERNET), but no BACnet devices are discovered. When I disable Wi-Fi, the devices on Ethernet are successfully discovered. The same code works perfectly on Android 7, where the app can discover devices using either interface, even when both are active.
Environment: Android Version: 12 (API level 31)
App Requirement: Wi-Fi is needed for general internet access. Ethernet is used for BACnet device discovery on the local network.
Implemented network binding logic using bindProcessToNetwork(). Used DatagramSocket for BACnet device discovery after binding to Ethernet. Ensured permissions are set for network access (ACCESS_NETWORK_STATE, CHANGE_NETWORK_STATE). Verified that device discovery works when only one interface is active (Ethernet or Wi-Fi). Tested the same code on Android 7, where it works as expected.
Network Binding Code
private static void bindToBestNetwork() { Network[] networks = connectivityManager.getAllNetworks(); Network ethernetNetwork = null; Network wifiNetwork = null;