最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - WebSocket HTML5 in the phonegap for android - Stack Overflow

matteradmin3PV0评论

I'm developing an HTML5 webapp which requires to use websocket, because the webapp needs to connect to a server(websocket server), all of this time, the webapp is working fine in a desktop browser-Chrome,

But now the web-app needs to be run in smartphones, and android will be the first priority (I don't have any experience developing android app), then I find a solution to build the web-app as an android-app using PhoneGap,

unfortunately, It doesn't support the websocket yet, I found many plugins but they all have their own server(java), what I need is a javascript library that will allow me to have the websocket run normally like it used to be in chrome, to any available ws server (I already made one in .NET using visual studio)

any idea or reference?

I'm developing an HTML5 webapp which requires to use websocket, because the webapp needs to connect to a server(websocket server), all of this time, the webapp is working fine in a desktop browser-Chrome,

But now the web-app needs to be run in smartphones, and android will be the first priority (I don't have any experience developing android app), then I find a solution to build the web-app as an android-app using PhoneGap,

unfortunately, It doesn't support the websocket yet, I found many plugins but they all have their own server(java), what I need is a javascript library that will allow me to have the websocket run normally like it used to be in chrome, to any available ws server (I already made one in .NET using visual studio)

any idea or reference?

Share Improve this question asked Mar 28, 2013 at 13:46 Eldon LesleyEldon Lesley 9356 gold badges20 silver badges39 bronze badges 1
  • Flash can open raw TCP connections. I don't how well android supports it, though. – freakish Commented Mar 28, 2013 at 13:48
Add a ment  | 

2 Answers 2

Reset to default 6

You can give https://github./mkuklis/phonegap-websocket a try. The demo app is here: https://bitbucket/mkuklis/phonegap-websocket-demo

Websockets are not natively supported in all android browsers. My best guess is to use an Phonegap plugin for websockets.

I suggest you take a look at https://github./FreakDev/PhoneGap-Android-HTML5-WebSocket or (an older) https://github./anismiles/websocket-android-phonegap

Post a comment

comment list (0)

  1. No comments so far