Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I connect with WebSocket in an Android app?

I have an Android app and I want to send a text from the Android application to the webpage using HTML5 WebSocket.

Is this possible and if so how?

like image 398
Jimmy Avatar asked Aug 01 '11 18:08

Jimmy


People also ask

Can I use WebSockets for mobile app?

If you have a custom client then yes, this is 100% possible.

Does App Engine support WebSockets?

You can use WebSockets to create a persistent connection from a client (such as a mobile device or a computer) to an App Engine instance. The open connection allows two-way data exchange between the client and the server at any time, resulting in lower latency and better use of resources.

Why you should not use WebSocket?

Avoid using WebSockets if only a small number of messages will be sent or if the messaging is very infrequent. Unless the client must quickly receive or act upon updates, maintaining the open connection may be an unnecessary waste of resources.

What is WebSocket Android studio?

WebSocket is a protocol that makes it possible to open a two-way interactive communication session between the client and the server. It provides a full-duplex communication channels over a single TCP connection.


2 Answers

I'm aware of 2 libs for Android supporting WebSockets from native apps

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

https://github.com/tavendo/AutobahnAndroid

Autobahn supports RFC6455 (the final WS spec), integrates well with UI and service apps and support RPC and PubSub over WebSockets.

Disclaimer: I am the author of Autobahn.

like image 129
oberstet Avatar answered Oct 06 '22 08:10

oberstet


A simple google search for 'android websockets' turned up this. He is referring to a GitHub project called websocket-android-phonegap.

like image 21
nicholas.hauschild Avatar answered Oct 06 '22 07:10

nicholas.hauschild