Questions tagged [nanohttpd]

NanoHttpd is a light-weight HTTP server designed for embedding in other applications. NanoHttpd has been released under a Modified BSD licence.

The first version of NanoHttpd was published in 2003. Originally, its author was looking for:

"a small enough, embeddable and easily modifiable HTTP server that I could just copy and paste into my other Java projects."

Later, another team took the project and fixed a number of bugs, moved the build to maven and pulled out the samples from the runtime JAR to further slim it down.

The two projects pooled resources in early 2013, merging code-bases, to better support the user base and reduce confusion over why two NanoHttpd projects existed.

You can view the project on GitHub: https://github.com/NanoHttpd/nanohttpd.

247 questions
4
votes
0 answers

Connecting to Android 4.4 phone itself (localhost) when in airplane mode

My Android App is running it's own webserver on port 24783. I can connect to it when I'm in my local wireless. I enter the local wifi ip and the port in the phones chrome browser and the website appears. However, when I'm offline (but the server is…
4
votes
1 answer

Why images and style files couldn't found on NanoHTTPD

PROBLEM : I'm using NanoHTTPD . It's working great but it's not serving .js files, images and others. DETAILED EXPLANATION : i have a pages folder inside of assets folder. This folder containing index.html, css files, images and others. I'm using…
Eray
  • 7,038
  • 16
  • 70
  • 120
3
votes
4 answers

Embeddable Java HTTP Servers

There seems to be multiple extremes when supporting embeddable Java HTTP servers. I have seen minimalist approaches such as NanoHTTPD and leveraging the com.sun.net.httpserver package to attempting to embed Jetty and Tomcat. The ideal embeddable…
McGovernTheory
  • 6,556
  • 4
  • 41
  • 75
3
votes
1 answer

Android Virtual Device: Accessing NanoHTTPD from hostsystem

I used NanoHTTPD for my android application. During the development I am running the app on an AVD. Is there a way to accessing the web service from my host system? What´s the IP address of the AVD?
Shrew
  • 31
  • 1
3
votes
0 answers

Session Management using Nanohttpd

I'm trying to create simple application for session management using Nanohttpd. I have used below project for reference. https://github.com/lopspower/AndroidWebServer I have two simple html page(sample3.html & sample.html) from them I want to create…
3
votes
1 answer

Is it possible to access an HTTP server deployed on an Android phone from another device on the same network?

I am using the NanoHttpd library to set up a server. It is currently serving a 'Hello World' HTML page. It is accessible from the browser of the phone on which it is deployed but not on other phones or laptops on the same WiFi. For example,…
Umang Mathur
  • 833
  • 1
  • 10
  • 32
3
votes
2 answers

What is the best way keep your app updated with server?

My app consists of login based user system in which the user will receive his tasks. User's list of task need to be regularly synced with the server so that any new task would reflect immediately on the app. I have done this kind of sync stuff…
Piyush Kumar
  • 623
  • 7
  • 11
3
votes
1 answer

play m3u8 file from internal storage using NanoHTTTPD

I have downloaded m3u8 and .ts files in internal directory of my app and when i try to play m3u8 file using Nanohttpd it shows a dialog "Can't play this Video". I have added my code below. Is it possible to play from app storage or do I need to…
Deepak John
  • 967
  • 1
  • 7
  • 19
3
votes
3 answers

How to serve a mp3 file using latest NanoHTTPD 2.3.0 in Android?

I have read How to serve a file on sdcard using NanoHTTPD (inside Android) The code return new NanoHTTPD.Response(Status.OK, "audio/mpeg", fis) doesn't be supported in latest NanoHTTPD 2.3.0 again. I try to replace it with return…
HelloCW
  • 843
  • 22
  • 125
  • 310
3
votes
0 answers

How to stream video on my video view from samba server ? How can I do it

I am stuck at this since very long and not getting any proper solution for it. I am using jcifs and samba to access shared folder from my windows Pc. Now I want to play the video file which I am getting from the shared folder. I have searched with…
Android Geek
  • 598
  • 1
  • 5
  • 20
3
votes
2 answers

Develop an Android Webdav server

in my app I have a NanoHttpd server https://github.com/NanoHttpd/nanohttpd but now I want to add a webdav support. I'm looking for some tutorial or advices to do that, but I found only jackrabbit library without any tutorial or guide. Have you some…
aeroxr1
  • 1,014
  • 1
  • 14
  • 36
3
votes
1 answer

How to have NanoHTTPD respond to AJAX

I'm attempting to get NanoHTTPD (on an android device) to respond to AJAX requests in a way that the requesting javascript can interpret the response. I've implemented the NanoHTTPD serve method: public NanoHTTPD.Response serve(String uri,…
Ian
  • 450
  • 4
  • 18
3
votes
1 answer

working example of nanohttpd in android studio

I have been trying to get an simple nanohttpd server running but I cant figure out how to set it up.. I have tried to follow this guide: Using NanoHTTPD in Android tried the first answer but I get an error on this line: "private WebServer server;"…
user3197004
  • 35
  • 1
  • 3
3
votes
0 answers

nanohttpd connection refused

I'm building an android app with xamarin. In it I need to load files from a local storage through a webserver into a webview. So I used NanoHttpd to create a webserver to serve files to the webview. Iloaded the jars into a jar binding library.…
Alex
  • 61
  • 5
3
votes
2 answers

Can't run jar with built in nanohttpd server in background (with nohup)

I have simple nanohttpd server implementation inside my application and it works fine when I am running it in regular way (java -jar myApp.jar). But when I am trying to run it as background process nanohttpd doesn't get http requests, browser just…
Alon Zilberman
  • 2,120
  • 1
  • 16
  • 16
1 2
3
16 17