Skip to content

An Android project with a library to manage socket connections, emits with ack and callbacks for views.

License

Notifications You must be signed in to change notification settings

cmarrero01/socket.io-client.java

Repository files navigation

socket.io-client.java

An Android project with a library to manage socket connections, emits with ack and callbacks for views.

Example

First import the library:

    import com.unvilsa.socket.*;

Second on your MainActivity, instance the socket:

    com.unvilsa.socket.Adapter socket = new com.unvilsa.socket.Adapter();

And Last on your OnCreate or when you needed, make an emit with your Callback function:

    Callback test = new Callback() {
        @Override
        public void OnFinished(JSONObject data) {
        	Log.i("DATA",data.toString());
        }
        
        @Override
        public void OnError(Object... args) {
        	Log.i("DATA",args.toString());
        }
    };
    
    socket.Emit("test", new JSONObject(), test);

That is All.

About

An Android project with a library to manage socket connections, emits with ack and callbacks for views.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages