I am new to Android development and I am trying to add a chatroom to my android app, powered by Rail's new actioncable. I currently have the chatroom working using Firebase which is cool. However, I would like to have additional features which aren't supported by Firebase so I want to move everything to my server. Problem is I don't know much about websockets on android.
Below is the javascript information being used on the rails browser side. This works without and issue.
hostname = (url) ->
parser = document.createElement('a')
parser.href = url
parser.href = parser.href
parser.protocol = parser.protocol.replace("http", "ws")
parser.href
@App = {}
App.cable = Cable.createConsumer hostname("/")
App.messages = App.cable.subscriptions.create "MessagesChannel",
received: (data) ->
messages = $('#messages')
messages.append(data.message)
messages.scrollTop(messages.height() + 1000)