NanoHTTPD

NanoHttpd server cannot stream large videos on android

我与影子孤独终老i 提交于 2021-02-05 20:30:37
问题 NanoHttpd server code can be found here. I'm starting a new Thread in a service that uses NanoHttpd server to stream large videos (about 150mb) but it just pauses right while the loading dialog is shown. I tried increasing and decreasing the buffer reads to no avail. It seems that the server cannot run properly on an Android device. Same code works fine when I start the server via desktop application. I can stream more than 150mb. When running the server from the phone, I only tried 20mb

使用NanoHTTPD在android实现web迷你服务器

≯℡__Kan透↙ 提交于 2020-02-29 12:47:51
NanoHTTPD的官方代码如下 import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintStream; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.net.URLEncoder; import java.util.Date; import java.util.Enumeration; import java.util.Vector; import java.util.Hashtable; import java.util.Locale; import java.util.Properties; import java.util.StringTokenizer; import java

使用nanohttpd,接收易语言的post数据问题

坚强是说给别人听的谎言 提交于 2020-02-29 11:53:10
session.parseBody( new HashMap<String, String>()); Map<String, List<String>> map = session.getParameters(); Iterator<String> i = map.keySet().iterator(); String s = i.next(); 最后这个s就是post过来的全部数据 易语言的post的头信息如下content-length=6431, remote-addr=175.9.235.15, accept-language=zh-cn, http-client-ip=175.9.235.15, host=121.196.238.126:11007, connection=Keep-Alive, content-type=application/x-www-form-urlencoded; Charset=UTF-8, accept=*/*, user-agent=Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 2Pac; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022) 数据类型是application/x-www-form

How to retrieve the array in server side using NanoHTTPD in Android when I post a array var in client side?

回眸只為那壹抹淺笑 提交于 2020-01-05 06:34:59
问题 In My.htm, I post a array var mytemp to server side, I hope to retrieve the array var in server side. I only get the a string D 1,D,2,Tom'Dog if I use the following code, how can I retrieve the array in server side ? Thanks! BTW, I hope to do a full post, not ajax, so I think that $.ajax() doesn't fit. My.htm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="js/jquery1.10.2.min.js?isassets=1" type="text/javascript"></script> <script type="text/javascript"> $

How to retrieve the array in server side using NanoHTTPD in Android when I post a array var in client side?

心已入冬 提交于 2020-01-05 06:32:26
问题 In My.htm, I post a array var mytemp to server side, I hope to retrieve the array var in server side. I only get the a string D 1,D,2,Tom'Dog if I use the following code, how can I retrieve the array in server side ? Thanks! BTW, I hope to do a full post, not ajax, so I think that $.ajax() doesn't fit. My.htm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="js/jquery1.10.2.min.js?isassets=1" type="text/javascript"></script> <script type="text/javascript"> $

How to retrieve the array in server side using NanoHTTPD in Android when I post a array var in client side?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 06:32:03
问题 In My.htm, I post a array var mytemp to server side, I hope to retrieve the array var in server side. I only get the a string D 1,D,2,Tom'Dog if I use the following code, how can I retrieve the array in server side ? Thanks! BTW, I hope to do a full post, not ajax, so I think that $.ajax() doesn't fit. My.htm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="js/jquery1.10.2.min.js?isassets=1" type="text/javascript"></script> <script type="text/javascript"> $

HTTPS Server on Android Device Using NanoHttpd

一个人想着一个人 提交于 2019-12-31 10:37:10
问题 I am trying to run an HTTPS Server on an Android device using NanoHttpd (my final goal is to run WSS server on Android). I successfully ran HTTP Server and Websocket using NanoHttpd on Android. I generated the key on MAC using this command and copied it onto my device: keytool -genkey -keystore key.keystore -storepass keypass -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider I wrote the following code: keyStore = KeyStore.getInstance("BKS"); keyStore.load(stream,

move file uploaded from nanohttpd's Temporary directory to SD card

*爱你&永不变心* 提交于 2019-12-23 03:12:10
问题 I am uploading a file "LICENSE.txt" from my PC to Android WebServerApp. NanoHTTPD uses a temporary directory to save the uploaded files. The temporary location is decided by : tmpdir = System.getProperty("java.io.tmpdir"); and file gets uploaded as : /data/data/com.manmohan.mynanoserver/cache/NanoHTTPD-1736025823 in my case. After the upload I want to move the file to my SD card "/storage/extSdCard/Uploads". Here's what I do : String tempFileName = entry.getValue().toString(); File fileToMove

Android embedded web-server

自古美人都是妖i 提交于 2019-12-23 00:39:28
问题 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 and AndroidHTTPD etc but not good documentation and I'm facing problems especially on how to give the ability to download the File. Is there any good tutorial/example that handles files or an easy-to-use library except of the ones I noted above?

Android embedded web-server

北城余情 提交于 2019-12-23 00:39:03
问题 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 and AndroidHTTPD etc but not good documentation and I'm facing problems especially on how to give the ability to download the File. Is there any good tutorial/example that handles files or an easy-to-use library except of the ones I noted above?