Hi,
I have an app which reads the temperature from a remote device. An external library is used and accessed via JavaObjects. In Debug Mode the temperature is returned correctly, but in Release Mode the value returned is 0, which is the initial value. When running the same app in B4J all works fine.
I found out that an error is returned "android.os.NetworkOnMainThreadException". So it seems that there is a thread conflict.
Has someone an example on how to handle multiple threads, in this case submit request to the remote device and capture the result.
Appreciated
I have an app which reads the temperature from a remote device. An external library is used and accessed via JavaObjects. In Debug Mode the temperature is returned correctly, but in Release Mode the value returned is 0, which is the initial value. When running the same app in B4J all works fine.
I found out that an error is returned "android.os.NetworkOnMainThreadException". So it seems that there is a thread conflict.
Has someone an example on how to handle multiple threads, in this case submit request to the remote device and capture the result.
Appreciated