Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FreakDev/PhoneGap-Android-HTML5-WebSocket
a little java implementation of missing WebSocket form Android webview
https://github.com/FreakDev/PhoneGap-Android-HTML5-WebSocket
Last synced: 4 months ago
JSON representation
a little java implementation of missing WebSocket form Android webview
- Host: GitHub
- URL: https://github.com/FreakDev/PhoneGap-Android-HTML5-WebSocket
- Owner: FreakDev
- Created: 2010-10-30T23:13:12.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-11-05T13:07:50.000Z (over 12 years ago)
- Last Synced: 2024-08-01T16:28:18.592Z (7 months ago)
- Language: Java
- Homepage:
- Size: 307 KB
- Stars: 79
- Watchers: 12
- Forks: 31
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Android HTML5 WebSocket
=======================A Java library that make the WebSocket object available for project that uses a WebView (like PhoneGap project's)
The iOS version of the plugin was already existant (http://github.com/remy/PhoneGap-Plugin-WebSocket) and works well
for me, but the Adnroid version was missing. here it is.Usage
=====* copy the Java source into the source folder of your project.
* copy websocket.js in your assets/www folder
* copy / paste these two line inside the onCreate of your activity
```java
WebSocketFactory wsFactory = new WebSocketFactory(appView);
appView.addJavascriptInterface(wsFactory, "WebSocketFactory");
```
* in your javascript, create a new WebSocket, and overload its method 'onmessage', 'onopen', 'onerror', 'onclick';