Android Netty Client

Posted on 2018-01-08 08:39  xl_phoenix  阅读(665)  评论(0编辑  收藏  举报

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

Copyright © 2024 xl_phoenix
Powered by .NET 9.0 on Kubernetes