Closed AlexMun86 closed 3 years ago
Are you sure your local endpoint actually has an ip address of 192.168.10.5? This is a typical error code if the address does not exist.
What happens if you leave local = new InetSocketAddress(0)
as is the default?
Yes, if it is the local IP on the computer? But when I set it local = new InetSocketAddress(0);
I get this error: 2021-05-24 15:28:12.752 16205-16205/com.example.myapplication8 E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.myapplication8, PID: 16205 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication8/com.example.myapplication8.MainActivity}: android.os.NetworkOnMainThreadException
And the app crashes.
Ah, android. You cannot do network access on the ui thread. You have to use a dedicated thread, async task etc.
Ok, is there any example on this here? Async task is deprecated in Android I think.
No there aren't.
Ok, I thought Calimero could be used in Android Studio
. But then I should find another solution.
Hi, I've tried this simple code to connect to my server. But I can't figure it out. Always getting this error:
from /192.168.10.5:3671 to /192.168.10.13:3671: bind failed: EADDRNOTAVAIL (Cannot assign requested address)
. What could be the problem?