We use react native for our Android app, maybe you can take a look at their websocket implementation as it works just fine with our app