After some tests, I found an internal issue:
- There was a defective wifi point in the office. Whenever the phone picked up the signal from this point there was no internet access. Which explained the incoherent behavior of some of my trials and error.
After disconnecting this faulty device I did some more tests and here are the results:
On a device using Android 5.1.1 everything works fine - no errors - proxy or not, the phone communicates with the server seamlessly.
On a device running Android 2.3.3 there is still an issue. Without the proxy, both the app and the internal browser work fine. With the proxy on, the app can't connect to the server anymore while the internal browser still can connect without any problem. I tried using both the httputils2 and okhttputils2 libraries and both fail to connect to the server giving the following error messages:
With HttpUtils2 - Error: org.apache.http.conn.HttpHostConnectException: Connection to
http://???.??? refused
With oKhTTPuTILS2 - Error: java.net.ConnectException: ???.???/xxx.xxx.xxx.xxx:80 - Connection refused
Any clues ?