android client for ezyfox server
android client for ezyfox server
https://youngmonkeys.org/ezyfox-android-client-sdk/
1. Create a TCP Client
val clients = EzyClients.getInstance()
val client = clients.newClient(config)
2. Setup the client
val setup = client.setup()
setup.addEventHandler(EzyEventType.CONNECTION_SUCCESS, ExConnectionSuccessHandler())
setup.addEventHandler(EzyEventType.CONNECTION_FAILURE, EzyConnectionFailureHandler())
setup.addEventHandler(EzyEventType.DISCONNECTION, ExDisconnectionHandler())
setup.addDataHandler(EzyCommand.HANDSHAKE, ExHandshakeHandler())
setup.addDataHandler(EzyCommand.LOGIN, ExLoginSuccessHandler())
3. Setup an application
val appSetup = setup.setupApp(APP_NAME)
appSetup.addDataHandler(Commands.SUGGEST_CONTACTS, SuggestContactsResponseHandler())
appSetup.addDataHandler(Commands.SEARCH_CONTACTS, SearchContactsResponseHandler())
appSetup.addDataHandler(Commands.ADD_CONTACTS, AddContactsResponseHandler())