#SignalA#
##Updates##
###2013-08-12 version 0.13###
- I've introduced the ability to send a custom querystring. erizet#24
- Changed when OnStateChanged is fired. Now the event is fired AFTER the new state is run. See erizet#21 (comment)
###2013-07-31 version 0.12###
- Fixed handling of groupstoken.
- Removed .metadata folder from repo.
- Use 'poll' instead of 'reconect' in urls for polling the server.
###2013-06-27 version 0.11### Two fixes in this release.
###2013-02-20 version 0.10beta released### I've changed a coupe of things in this release.
- I have changed the transport. LongPolling now uses basic-http-client instead of Aquery for http communication. I've removed all dependencies on Aquery.
- Hubs is now implemented. Checkout my implementation and say what you think about it. Calling functions on server from client, and calling functions on client from server is supported. NOTE! State is not implemented yet.
- I've included a new sample, HubDemo, in the repo. It shows how you can implement hubs.
- I have also set up a SignalR server on Appharbor so HubDemo can talk to it. You'll find it here.
###2013-02-20 version 0.9beta released### 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.
##Description## 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.
##How to use?##
To use SignalA you have to get a copy of the two libraries, SignalA and SignalA.LongPolling. Add a reference to SignalA.LongPolling under Properties > Android > Library. Then 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.
##Limitations## Hubs dont supprt State yet.
##Contributions## I'll be more than happy to get contributions!!!
##Are you using SignalA?## If you're using SignalA I would appreciate to hear from you - where and how are you using it?
##License##
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.