I will no longer update this library.
Two fixes in this release.
I've changed a coupe of things in this release.
Version 0.9beta uses the SignalR-protocol version 1.2 which is used in the 1.0 release of SignalR. It has also (beta)support for groups.
SignalA is a SignalR-client for Android. It's implemented as a Android-library. At this moment is long polling the only implemented transport. Long polling is a separate library. Http-requests in the Long polling library is using basic-http-client.
SignalA is published on Maven Central as a ARR. If you're using Android Studio/Gradle all you have to do is add it on your gradle build:
dependencies {
compile 'com.github.erizet.signala:signala-longpolling:0.20'
}
Add the following code to your activity.
String url = "http://<address to your SignalR-server>";
con = new com.zsoft.signala.Connection(url, this, new LongPollingTransport()) {
@Override
public void OnError(Exception exception) {
Toast.makeText(DemoActivity.this, "On error: " + exception.getMessage(), Toast.LENGTH_LONG).show();
}
@Override
public void OnMessage(String message) {
Toast.makeText(DemoActivity.this, "Message: " + message, Toast.LENGTH_LONG).show();
}
@Override
public void OnStateChanged(StateBase oldState, StateBase newState) {
}
};
To start and stop the SignalA connection use code similar to the following.
public void startSignalA()
{
if(con!=null)
con.Start();
}
public void stopSignalA()
{
if(con!=null)
con.Stop();
}
That's it!
For a complete sample see the Demo-project.
Hubs don't support State yet.
I'll be more than happy to get contributions!!!
If you're using SignalA I would appreciate to hear from you - where and how are you using it?
Copyright 2013 Erik Zetterqvist
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Disclaimer: I'm a .NET-coder and this is my first attemt to write a Java-library so bare with me.