Skip to content Skip to sidebar Skip to footer

Websocket Not Working On My Android App (with Phonegap Build)

I tried to develop a simple mobile application that connect to a websocket server. I used Phonegap Build to make my Android .apk, here's the html code : &

Solution 1:

WebSockets are only supported in WebView after Android 4.4. So if you want to use it in older android versions ,you have some choices:

  • Use a Cordova plugin that provides that functionality. For example, https://github.com/knowledgecode/WebSocket-for-Android (this is just an example, I have never worked with that plugin)

  • Use something like SockJS or socket.io to provide webSockets when supported and fallback to other technologies when not. Please note that using those technologies requires you to use them also in the server


Post a Comment for "Websocket Not Working On My Android App (with Phonegap Build)"