Question

I'm developing an ASP.NET MVC app that is consumed by both by JavaScript in the browser and by a native Android app, and I wish to use SignalR. This is of course no problem in the browser, but I do not know how to interface from the Android app.

Are my only options:

  1. Find a pre-existing Android SignalR library. or
  2. Write custom code to interface with the server side SignalR interface?
Was it helpful?

Solution

I'm unaware of any Java based implementation that you could use in an Android application right now. So I think you're looking at option #2.

Java certainly has the core functionality needed to to be able to communicate with at least the long-polling transport implementation of SignalR pretty easily. You'd just be looking at combining HttpClient with org.json.

OTHER TIPS

I was also searching for a SignalR-client for Android, but i didnt find one so I started to develop one by myself. You can checkit out at https://github.com/erizet/SignalA. Curently it's more like a proof-of-concept than a finnished library. It's now updated to protocol version 1.2 which is used in the 1.0 release of SignalR.

If HTML5-based Android app is an option, you can try using native SignalR JavaScript client. Works flawlessly.

Host a hidden webview in your application and use the script bridge to talk to it. Use the javascript signalr libraries in your webview.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top