Code Monkey home page Code Monkey logo

wifi-chat's Introduction

WIFI-Chat

漏洞检测

基本功能

1.上线、下线

2.在线列表

3.消息发送

网络通信

核心通信代码借鉴了kouchat

UDP服务端口 12425(用于监听单播或广播消息,服务端类是DatagramSocket)

UDP服务端口 12426(用于监听组播消息,服务端类是MulticastSocket)

TCP服务端口 12425

数据包

数据包内容以 :隔开 例(协议版本:包序号:发送者用户名:命令字:消息正文)

数据库表设计

消息表

字段 数据类型 注释
id bigint 消息类型
type tinyint 消息类型 (1:文本 2:位置 3:附件通知)
msg_time text 消息内容
content datetime 消息发送时间或接收时间

用户关系表

Tables Are Cool
username 当前登录用户的用户名
msg_id bigint 消息id
dir_type 消息方向(1:当前用户发送的消息 2:当前用户收到的消息)
other_username varchar(32) 对方用户名(当前用户发送的消息,对方用户为消息接收者.对于当前用户收到的消息,对方用户为消息发送者)
other_name varchar(128) 对方姓名
status tinyint 消息发送状态,该字段只对当前用户发送的消息有效(0:发送中 1:出错2:送出)
is_read tinyint 当前用户是否已读消息,该字段只对当前用户收到的消息有效(0:当前用户未读 1:当前用户已读)

附件表

字段 数据类型 注释
id bigint 系统自增ID
msg_id bigint 消息id(这里为附件通知消息的id)
file_uuid varchar(48) 附件uuid
type tinyint 附件类型(1照片2音频3视频4文件)
filename varchar(128) 文件名称
size bigint 文件大小,单位:byte
uri varchar(1024) 文件本地存储路径。对于文件发送方,该字段为发送文件所存储在本地的路径;对于文件接收方,该字段为接收文件所保存在本地的路径。
status tinyint 文件下载状态,对于当前用户接收文件有效 0:下载未完成 1:下载完成

引用到的第三方库

gson

litepal

rxandroid

rxjava

logger

photoview

matisse

rxpermissions

不足以及改进

第三方库使用比较零散 未包装

数据库设计

Android5.0版本以后的权限问题

wifi-chat's People

Contributors

ruanhaoandroid avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.