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
2
votes
5 answers

NanoHTTPD How to save uploaded file to sdcard folder

How to save uploaded file to sdcard folder , currently it stores to /data/data/cache folder with filename like "NanoHTTPD-some random number". I am not able to copy it to any folder location in sdcard. I would like to save the file to a…
2
votes
1 answer

NanoHTTPD how to present variable from app

I play NanoHTTPD and WebServer based on it. To update any object in my code (application) I can use GET/POST method. But how can I create dynamic pages? For example I have html page on disc and it should present current temperature: …
Genzi
  • 83
  • 1
  • 6
2
votes
1 answer

iPhone can not play video from my web page (server)

I am streaming video using NanoHTTPD from android device. Every device can play the video file in web page or using external media player except iPhone. Even Mac desktop can play the file too. I manually pushed the video file into iPhone and it's…
shantanu
  • 2,408
  • 2
  • 26
  • 56
2
votes
0 answers

Wrong behavior with big files and nanoHTTPD and WebView on Android

I'm using nanohttpd on Android to serve content to my WebView (The ContentProvider approach was broken in KitKat version, THANKS SO MUCH GOOGLE !!!), my issue comes when I try to send a MP4 file as response, when the fisrt request comes a return the…
2
votes
0 answers

NanoHTTPD EACCES (Permission denied) on Android 4.0.4, 4.4.4 ok

I set my permissions in AndroidManifest: And it's my java code: public class AndroidWebServerActivity extends…
user1209216
  • 7,404
  • 12
  • 60
  • 123
2
votes
0 answers

NanoHTTPD in Android serving multiple files webpage

I am using NanoHTTPD in an Android application to serve a webpage that is forced to be hosted in a server, so I can't load it directly to the webview. If I load a single html file, the server and client works. If I then serve an index.html with…
XaviGG
  • 171
  • 2
  • 19
2
votes
1 answer

android - How to set file name using FileInputStream?

I'm developing an app that will send a file using HTTP server (with nanoHTTPD) to another device by typing the sender's IP:port. The transferring is working correctly, but I'm not able to receive the right file name of the sent file (its being named…
2
votes
1 answer

NanoHTTPD 2.0.5 issue with file upload with spaces in filename

I have an android app that uses NanoHTTPD to serve HTML context. I'm using NanoHTTP 2.0.5 in my App. There's a problem with file uploads. Suppose I upload a file named kr d.mp4; it gets uploaded but renamed to k (starting from one character before…
Manmohan Bishnoi
  • 791
  • 13
  • 37
2
votes
1 answer

NanoHTTPD: determine origin of request

How to determine the IP address that originate the request? My current code: @Override public Response serve(String uri, Method method, Map headers, Map parms, Map files) { …
Arvin
  • 1,210
  • 2
  • 15
  • 18
2
votes
1 answer

How do I serve external css, jpg and gif files from Nanohttpd (Nanohttpd run on a normal pc not on Android)?

In index.html, External css is used and paths to image src are used to request css images from a folder. However the images are not loaded and css style is not applied to the page. import java.io.*; import java.util.*; /** * An example of…
Samseth
  • 81
  • 1
  • 6
2
votes
1 answer

Android embedded web-server

I want to embed a web-server in my android application where devices connecting to it will have two abilities. One is send an xml-file that I can parse and do some stuff and the other to be able to download a file from my sd-card. I found nanoHTTPD…
Panos
  • 7,227
  • 13
  • 60
  • 95
2
votes
0 answers

iOS socket connection to Android through the same wifi

I have an iOS app and an Android app. The android app will act as "server" and the iOS app as "client". I want two cases: To be able from the iOS app to request a file from the android app and download it on the iOS device. To send a String or an…
Panos
  • 7,227
  • 13
  • 60
  • 95
2
votes
3 answers

how to change port 80 android

I made a webserver on my android device(using Nanohttpd). It's working fine over the port 8080 but I want to make it okay over the port 80,(I want to tape on my browser : http://192.168.x.x instead of http://192.168.x.x:8080/ ) but I'm not able to…
AndroidM
  • 411
  • 4
  • 7
  • 20
2
votes
2 answers

android, Force Close in a NanoHTTPD project

I'm implementing a custom web server by using NanoHTTPD. I have BaseServer class that extends NanoHTTPD: public class BaseServer extends NanoHTTPD { public BaseServer(int port) { super(port); // TODO Auto-generated constructor…
Masoud Nazari
  • 476
  • 2
  • 6
  • 17
2
votes
2 answers

file uploading error nanohttpd

I used below code to upload files using NanoHTTPD, but nothing is being uploaded nor giving me temp path. Code is: new Response( HTTP_OK, MIME_HTML, "
gajiwala
  • 43
  • 4