Android netty client
Start a netty client on android
Download netty
Download url :https://netty.io/downloads.html
Download netty-all.jar and put it into libs. Then add as library.
Project structure
netty
ClientWrapper
ControlClient
MessageProtocol
ServerException
ServerStatus
StatusListener
TcpProtoCodec
Constants
MainActivity
MessageEvent
ClientWrapper: package ControlClient, use single mode. init and notify server status change.
ControlClient: connect server, send message and listen status change.
MessageProtocol: netty send and receive message format.
ServerException: exception
MessageEvent: use for eventbus.
MainActivity: input server ip and port, connect server and send message
Communication protocol
'R' + data.length + data