EDIT - made the example much simpler, see next reply
I’m trying to write a simple iOS and Android app which sends and receives OSC messages. I’m storing the address and ports for the OSCSender and OSCReceiver objects in the ApplicationProperties file and loading them and connecting when the app starts. This all seems to work fine for the moment.
I’ve also got a settings component which I set as visible from a button on the main screen. In this component I have some text fields into which the user can enter a new address and ports to send to and receive from. A button in the settings component sends a change message to the mainScreen component, which then takes the text fields’ text and saves it to the properties file and hides the settings component.
Then it disconnects the currently connected OSCSender and OSCReveiver objects and tries to connect using the new details, reloaded from the app properties.
I know this probably isn’t the most elegant solution but I’ve gone through a few methods to try and get this to work and this is the latest. The problem is that the reconnection seems to make the Android version freeze when reconnecting (I think) the OSCReceiver. It seems to work fine on the iOS version and on Windows.
Is there a problem disconnecting and reconnecting an OSCReceiver in Android or, more likely, am I doing something wrong in my code? Please see github link below – it’s just a test and doesn’t actually send or receive anything yet, just tries to connect and reconnect.
Any help appreciated!