WebSocket的Andr​​oid中的WebView [英] WebSocket in Android WebView

查看:277
本文介绍了WebSocket的Andr​​oid中的WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我的问题是,我正在开发一个使用一个WebSocket的一个应用程序。在iOS上一切工作了罚款,但在Android上的WebView不支持WebSocket的。最新最快/最优雅的方式来解决这个问题?

由于这个职位是经常我想分享一些可能的解决方案看。

解决方案:

  1. 在Java的WebSocket的客户端实现与功放; JavaScript的接口
  2. 在PHP的WebSocket客户端实现与功放;做一个背景(即jQuery的GET)请求到PHP脚本的(为我工作,我想只发送一条线的消息。)

机器人的WebSocket库

<醇开始=3>
  • http://autobahn.ws/
  • HTTP://$c$c.google.com/p/weberknecht
  • 有人有同样的问题,并descriped他是如何工作围绕

  • http://chpeck.tumblr.com/post/ 37273036645 /插座IO-与-的Andr​​oid的WebView
  • 解决方案

    的Andr​​oid的WebView不能容纳​​的WebSocket。所以,你需要实现一些WebSocket的库。

    jWebSocket http://jwebsocket.org/

    weberknecht HTTP://$c$c.google.com/p/weberknecht/

    today my problem is that I am developing an app that is using a WebSocket. On iOS everything is working out fine but on android the WebView doesn't support the WebSocket. Whats the fastest/most elegant way to solve this problem?

    [edit]

    As this post is viewed quite often I want to share some possible solutions.

    Solutions:

    1. Java Websocket Client Implementation & JavaScript Interface
    2. PHP Websocket Client Implementation & making a background (i.e. jQuery GET) request to the PHP-script (worked for me as I wanted to send only one line of message.)

    Android Websocket Libraries

    1. http://autobahn.ws/
    2. http://code.google.com/p/weberknecht

    Someone had the same issue and descriped how he worked around

    1. http://chpeck.tumblr.com/post/37273036645/socket-io-with-android-webview

    解决方案

    Android webview doesn't accommodate WebSocket. So you need to implement with some WebSocket library.

    jWebSocket http://jwebsocket.org/

    weberknecht http://code.google.com/p/weberknecht/

    这篇关于WebSocket的Andr​​oid中的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆