Skip to content
Felix edited this page Aug 27, 2014 · 3 revisions

Android

The program was tested on a Cyanogenmod-11.0 Android tablet.

Build instructions

Edit the Makefile and make sure the following lines are as they come: CC=arm-linux-androideabi-gcc CC_FLAGS=-static -Wall -pedantic -std=c99

Use the arm-linux-androideabi-gcc-Compiler and make sure the "-static"-flag is set in the compiler options!

Or compile it using

arm-linux-androideabi-gcc -static -Wall -pedantic -std=c99 -o nanoHttp nanoHttp.c -D_POSIX_SOURCE

Place it in /system/bin

root required! Remount the /system directory in read-write mode, copy the file, and remount /system again in read-only mode:

  • mount -o remount,rw /system
  • cp /storage/sdcard/nanoHttp /system/bin/
  • mount -o remount,ro /system

Start on system boot

Place the following file in cd /data/local/userinit.d/99nanoHttpd

#!/system/bin/sh umask 077 # Modify "/storage/sdcard/www" - Change the directory your html contents are placed /system/bin/nanoHttp -w /storage/sdcard/www &

Clone this wiki locally