GithubHelp home page GithubHelp logo

freakdev / phonegap-android-html5-websocket Goto Github PK

View Code? Open in Web Editor NEW
79.0 12.0 31.0 314 KB

a little java implementation of missing WebSocket form Android webview

Java 92.11% JavaScript 7.89%

phonegap-android-html5-websocket's Introduction

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
   WebSocketFactory wsFactory = new WebSocketFactory(appView);
   appView.addJavascriptInterface(wsFactory, "WebSocketFactory");
  • in your javascript, create a new WebSocket, and overload its method 'onmessage', 'onopen', 'onerror', 'onclick';

phonegap-android-html5-websocket's People

Contributors

freakdev avatar indrekv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phonegap-android-html5-websocket's Issues

apache server

Hey buddy.

I have a question, I'm using apache tomcat 7 as a websocket server, and I'm developing an android application with jquery and phonegap, so my question is if I can use your library with apache server or not.

Please reply as soon as you can.

Thanks,
Shahe

compartibility with Socket.io

Thanks for the effort making websocket available for Android webkit. Does this work with the socket.io and Node.js framework please?

execJs is undefined

I do get this error:

This method execJS(String) is undefined for the type Websocket

Any ideas how to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.