Websockets, Android and Phonegap
Posted: Mon Jun 30, 2014 10:35 pm
Hi, I know that mine is a very particular situation, but I'm asking if anybody has ever had to do with programming Phonegap webapps with websocket communication to Airconsole.
The situation is:
if I run the websockets Airconsole demo in an android phone starting from chrome browser, after having transferred .html and .js file onto the phone and opening the .html file by using file:///<path to the html file>, and after having connected in wi-fi to the airconsole, everything is ok.
Then I try to package a webapp with phonegap, and, using the cloud compiler build.phonegap.com after having configured the websocket plugin available, I can build an apk that I can install to the smartphone. The webapp so built uses the android webview component, that, itself, seems to be not providing websocket support, so the plugin comes to help.
But the connection isn't working, and it stops just as soon as
this.websocket = new WebSocket(uri, protocol);
is called in the connect function. As I only use console logs to debug the app, I cannot know why the call is failing, I can only see that the last log is the one before that call.
Thank you for any help and sorry for the very strange situation, but I think it may occur to someone else so I posted the question.
Bye
The situation is:
if I run the websockets Airconsole demo in an android phone starting from chrome browser, after having transferred .html and .js file onto the phone and opening the .html file by using file:///<path to the html file>, and after having connected in wi-fi to the airconsole, everything is ok.
Then I try to package a webapp with phonegap, and, using the cloud compiler build.phonegap.com after having configured the websocket plugin available, I can build an apk that I can install to the smartphone. The webapp so built uses the android webview component, that, itself, seems to be not providing websocket support, so the plugin comes to help.
But the connection isn't working, and it stops just as soon as
this.websocket = new WebSocket(uri, protocol);
is called in the connect function. As I only use console logs to debug the app, I cannot know why the call is failing, I can only see that the last log is the one before that call.
Thank you for any help and sorry for the very strange situation, but I think it may occur to someone else so I posted the question.
Bye