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
1 answer

Extending NanoHTTPD

I need to write a HTTP server program in Java that Process SOME requests (i.e, having certain parameters) to store some data sent from clients, and. The rest of requests show a "home" page, showing the data received from the clients. The problem…
0
votes
1 answer

Using ajax to send back JSON to Android nanoHTTPd function

Hey all I am trying to POST some json data to my android app via Jquery AJAX and using NanoHTTPd as the web server. I can seem to call the correct url doing this: var reqData = JSON.stringify({"AppName": "test", "Enabled": "yes"…
StealthRT
  • 10,108
  • 40
  • 183
  • 342
0
votes
2 answers

Streaming byteArray video in Android

How can I stream video from byteArray fun streamVideoListener(frame: ByteArray){ // receiving H.264 frames every 100ms. } I tried FFmpeg library. merged 100 frames and make few seconds video and add it to ExoPlayer playlist. but performance…
0
votes
0 answers

Can not bind the domain to AWS EC2

I use EC2. So far I have been using Elastic IP to get a static IP. And I was able to bind the Htttp server to an AWS prepared domain like ec2-xx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com and run it. This time, I got a domain from an external…
0
votes
0 answers

NanoHTTPD Android Library for Serving webpage for youtube playback

i am trying to play a youtube video in android through NanoHTTPD android web server library using a html form by providing the youtube id of some video in the served html file into the html form. So far i got the youtube video player working. And i…
0
votes
0 answers

Cannot invoke "java.io.InputStream.readAllBytes()" because the return value of "java.lang.Class.getResourceAsStream(String)" is null

I use NanoHTTP to set up a web server with HTML, JS and some Java. Now I want to get the JavaScript resource out of the HTML by using private String readFileAsTextUsingInputStream(String filename) { if(Objects.equals(filename, "/login")) { …
Erwin109
  • 17
  • 6
0
votes
0 answers

Cannot resolve symbol 'NanoHTTPD'

I am trying to build NanoHTTPD into my project. I didn't find a solution in the other "Cannot resolve symbol" question on StackOverflow so I am trying this here I am sorry. This is a pretty fresh project. I added the dependency of httpd in the…
Erwin109
  • 17
  • 6
0
votes
1 answer

How download an installed app with nanohttpd

Hello i want to make a http server with nanohttpd that shows installed apps, and convert them to apk and download. I can list but how can i download the app i select List packages =…
jcooli
  • 1
  • 5
0
votes
1 answer

Download Excel file from Nano httpd web server

I have an excel file in my Android phone whereby i want to download this file by Nano Httpd web server,I am reading excel content and return as a Nanohttpd's response : File excelDirectory = new File(GenericContext.getContext().getFilesDir(),…
M.Minbashi
  • 244
  • 1
  • 3
  • 12
0
votes
0 answers

Sharing files with nanohttpd in android

i need to develop an android app, a chat app, in which the two devices should be connected via wifi direct and share files via nanohttpd. can anyone share a guide for this ?
0
votes
1 answer

Exoplayer, NanoHTTPD : Exoplayer is not able to play a .mp3 file that I am hosting on my NanoHTTPD server

The Exoplayer is throwing an exception "UnrecognizedInputFormatException". The files are .mp3 files and I am able to play the file on browser or by using MediaPlayer library on android. Here is the code that I am using to serve the file: public…
0
votes
1 answer

NanoHTTPD - write to a socket instead of copy a string to deliver pages

This question is not about how NanoHTTPD can deliver streaming content, or how it can leave the HTTP socket connection open after serving a page. I generate HTML very responsibly, with HTML.java, by passing in a Writer that assembles all the content…
Phlip
  • 5,253
  • 5
  • 32
  • 48
0
votes
1 answer

Gradle Builds with NanoHTTPD, but class cannot import

This is probably a really stupid question, but after messing with this for 2 hours, I cannot seem to resolve. I am wanting to use nanohttpd in an android app as a lightweight local webserver. The gradle seems to find nanohttpd and builds just fine…
Equinox
  • 15
  • 1
  • 6
0
votes
0 answers

How to Upload a file from web to android web server using NanoHttp

I need to use android device as web server and browser as client. I need to be able to upload file from client to android device, I really don't know how. I really don't understand anything from Http stuff and nano.
SinaMN75
  • 6,742
  • 5
  • 28
  • 56
0
votes
0 answers

NanoHTTPD - This site can't provide a secure connection

I created a NanoHTTPD Server on Android. I was able to create an https server on my previous work, but it's not secure. I want it to have added security like the one with the green padlock because I'm having problems connecting to the server on iOS…
user8248810
  • 36
  • 1
  • 3
  • 11