an easy NanoHTTPD example for android app. inspire by Spck

git@yoqi.me 1e3141e142 shrinkResources true 6 months ago
.github 34aa3593c3 set jdk 1.8 to 11 6 months ago
app 1e3141e142 shrinkResources true 6 months ago
gradle 4853b2bba6 update gradle 6 months ago
.gitignore fcf3e254ef init 3 years ago
LICENSE 3ba30e57ee add license and update grade 1 year ago
README.md fa7ea19c5d 完成基本的 httpd 3 years ago
build.gradle 4853b2bba6 update gradle 6 months ago
gradle.properties fcf3e254ef init 3 years ago
gradlew aacef3b0c8 add premission 6 months ago
gradlew.bat fcf3e254ef init 3 years ago
settings.gradle fcf3e254ef init 3 years ago

README.md

NanoHTTPDemo

Spck 启发

最近在android 编辑器软件 Spck Editor 看到很多 vscode 特色,全局搜索,git管理,PC 和 mobile 跨平台适配。拥有这么多功能安装包才 7M ,那么具体怎么实现的呢?简单反编译发现其实采用 vscode 类似 nodejs 基础的编码,通过 NanoHTTPD 启动一个本地服务器:端口7600。这样就可以直接使用已开源的IDE的优势,而且可以在 android 手机端使用。

NanoHTTPD 简单使用

那么本项目学习一下 NanoHTTPD 的用法。

(1)下载 nanohttpd-2.2.0.jar 包: https://github.com/NanoHttpd/nanohttpd/releases

(2)