0

I have an application that runs on Android phone. I would like to add web ui like let's say torrent applications. I would like to manage my application from browser using my laptop, or another phone located on a different side of the planet ;)

What is the easiest way to run a web server inside app, and host a management web app? Is it possible to run nodejs/php server inside application and communicate with hosted web app? Should be possible, because ttorrent and x-plore have such feature.

Thanks for any clues and advices.

Jarek
  • 5,885
  • 6
  • 41
  • 55

1 Answers1

1

I did several in-app web server projects. nanohttpd and golang are used in my projects.

Nanohttpd is wrote in pure Android SDK compatible Java. You can call any Android SDK API, with no need of RPC or language binding. But nanohttpd has little supports to develop web API. It's not a good choice if you have lots of APIs between javascript and the in-app server, but good if you need invoke Android SDK APIs in the in-app server.

golang supports Android(ARM Linux) well. The good parts are:

  1. static link. you just need coding and build, everything will in one shared library file, you can ease use the library in your Android project
  2. powerful APIs in standard library to develop a web server and web client. Great performance because of golang's async I/O and thread model
  3. gomobile provide a tool to generate RPC wrapper for golang-java inter-operation. golang-c(jni)-java wrapper will also work but I not found a tool to generate the binding, writing bindings is boring.
Jiang YD
  • 3,205
  • 1
  • 14
  • 20