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
0
votes
0 answers

On the fly create, encrypt and stream ZIP to client via NanoHTTP

I try to create a zip file and on-the-fly via NanoHTTPD That is what I currently have: @Override public Response serve(IHTTPSession session) { String uri = session.getUri(); if (uri.toString().equals("/test.zip")) { …
Alex
  • 32,506
  • 16
  • 106
  • 171
0
votes
1 answer

NanoHTTPD: Display images

I'm trying to display an image on a browser using NanoHTTPD server, but always nothing to display. This is a part of my serve method: else if(uri.contains(".png")){ SmallBinaryFiles smallBinaryFiles = new SmallBinaryFiles(); InputStream is…
mbazouz
  • 35
  • 6
0
votes
1 answer

Why is the value of a private var different from the value of a local var in NanoHTTPD?

In my mind , the value of private String uri and the value of local var String newURI will be the same in any time. But in fact, I test many times, sometimes the two values are not the same, why? What happened with NanoHTTPD ? Guess I guess the…
HelloCW
  • 843
  • 22
  • 125
  • 310
0
votes
1 answer

I'm trying to play a encrypted video using videoView with the help of nanohttpd.but it's not working don't know why?

I'm thinking the problem in response part but did not figure out where to look out. Error i get when playing the video: D/MediaPlayer: Couldn't open file on client side, trying server side MediaPlayer: error (1, -2147483648) E/MediaPlayer: Error…
a_vasim
  • 13
  • 5
0
votes
0 answers

how can cast local data to chromecast device

I want to cast local data (Image/Video) that are selected from gallery and served on the local web server using NanoHTTPD server. code to serve the image is : public class MyServer extends NanoHTTPD { FileInputStream fileInputStream; private…
jyoti
  • 1
  • 1
0
votes
1 answer

Live camera streaming with Nanohttpd in android

I am developing an android project which send live camera stream to Nanohttpd server by using wifi,how can i achieve this,Is it possible? Any help? Thanks!
User123
  • 1
  • 2
0
votes
1 answer

What can I use to set cookies in Java?

I am using a nanoHttp server. Nothing I have tried will work. I need to be able to click on one link (http://localhost:9090/createCookie) that calls a method to create a cookie for a different link (http://localhost:9090/application). NanoHttp…
Vickie
  • 89
  • 1
  • 9
0
votes
2 answers

NanoHTTPD serves empty file

I'm trying to add Google Cast functionality to a media app of mine which primarily deals with locally stored media. As there is no way for the cast receiver to gain direct access to files stored locally on the device, I'm using NanoHTTPD to run a…
Julian Os
  • 281
  • 1
  • 15
0
votes
1 answer

How to call native android code from a page served using nanohttpd server?

I wish to create a web interface for my android application wherein the user can connect using WiFi and do "stuff" similar to the web interfaces provided by many file sharing services like Xender. I am using nanohttpd to host the web interface. I…
Ray
  • 293
  • 1
  • 3
  • 12
0
votes
1 answer

Reading POST Ajax array parameters in NanoHttpd

I'm a NanoHttpd newbie. I'm shifting my Java EE servlet code into NanoHttpd for embedded usage. Please don't recommend other embedded servers like Jetty, I'd like to use NanoHttpd in particular. My jQuery Javascript code looks like this: $.ajax({ …
jyonkheel
  • 443
  • 4
  • 17
0
votes
1 answer

Display image with Chromecast

I'm developing a gallery app and I want it to be compatible with the Chromecast. I searched and tried for days but I can't get it to work. I learned that I need to create a webserver (NanoHTTPD) and send the url of the image. Can someone show me a…
MattButtMatt
  • 461
  • 2
  • 11
  • 26
0
votes
1 answer

nanohttpd demo App crashed after 15seconds

I want to find a light http service for my Java program, and after research, I find nanohttpd is so light with only one java page, and easy installation, so I want to wrap my Java program with this framework. I have tried tutorial on nanohttpd…
richardzrc
  • 33
  • 7
0
votes
1 answer

How to change address in url (http://localhost:8080/HELLO_WORLD) in NanoHttpd

My query is how to change how to change address in URL (http://localhost:8080/HELLO_WORLD). I change HELLO_WORLD to desire word. @Override public Response serve(IHTTPSession session) { String answer = ""; BufferedReader reader =…
bob jeff
  • 25
  • 8
0
votes
1 answer

NanoHttpd SimpleWebServer crashes on static constructor

Currently I have a need in local http file server in Android app and I decided to use NanoHttpd SimpleWebServer. But I encountered such exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int…
Alviere
  • 403
  • 1
  • 4
  • 14
0
votes
0 answers

NanoHTTPD with deleted requests

How do I check the operation of the library to perform http delete request. The following code is used to verify the sleduyuschischy @Override public Response serve(String uri, Method method, Map headers, Map parms,…