NanoHttpd / nanohttpd

Tiny, easily embeddable HTTP server in Java.
http://nanohttpd.org
BSD 3-Clause "New" or "Revised" License
6.92k stars 1.69k forks source link

NanoHttpd Server Stop on Oreo OS automatically #521

Open sumit-vuliv opened 5 years ago

sumit-vuliv commented 5 years ago

Hi All, We have used the Nano Httpd Server for making local Server in Android Application.We have successfully implemented this Sdk in our Application and working fine but from Oreo OS in Android It Stops randomly. We are not able to detect the exact Reason why it is not working in OREO os only. Please help us if any one have face this iisue in OREO OS of Android,Its is urgent So please ping me as soon as possible.

Thanks in advance. Sumit Agrawal

LordFokas commented 5 years ago

Currently I'm the only (somewhat) active team member, and I suck at Android. With a little time someone else might drop by and bring valuable insights though :)

b202i commented 5 years ago

I am having the same Android problems. Prior to Orieo, the same nanohttpd configuration worked fine for that last 3 years.

From a remote computer attached to the hotspot

From the browser I get: **ERR_ADDRESS_UNREACHABLE**  
Ping gives me a **Request timeout**  
Traceroute gives me **No route to host**  

Webview from the same app running nanohttpd on the hotspot gives me:

net::ERR_ADDRESS_UNREACHABLE

When I put the Android/nanohttpd and remote computer on the same WiFi, everything works perfectly.

NoahAndrews commented 5 years ago

Is the app in the foreground when you encounter the issue? If not, my guess is that you need to run NanoHTTPD from a foreground service. Background services got new restrictions in Oreo.

b202i commented 5 years ago

Is the app in the foreground when you encounter the issue? If not, my guess is that you need to run NanoHTTPD from a foreground service. Background services got new restrictions in Oreo.

This is a good thought however I think it is a hotspot issue. After the upgrade to Android 28 Oreo, the apps continue to operate fine on WiFi but fail when operating over an Android hotspot.

Nuvolect commented 5 years ago

This is still an outstanding issue. To run the code you can side load it here:

https://github.com/Nuvolect/SecureSuite-Android/tree/master/signed_apps

It is also opensource if you want to look at the code.

julientype commented 4 years ago

Android System WebView remove it ....... its a system webview it hooks up to all apps running web views ..... its garbage..... like if your app has no open gl i will fix it for you....lol... really stupid.... i thinks an add bot hook... i ran a debug pka with studio.... it tries to hook in ..... web views render simple html thats should be isolated by the install.... it really should be done at the sdk for app builders not 24hr a day on your phone.... Android System WebView <<<< all software under v 5 have old web-views its now a full iframe in 5.1 not a web view ..... yet the they still run hooks into apps.......