1

My simple web server is Python3 SimpleHTTPRequestHandler and it works just fine. It runs in a LAN machine's picture folder and I have tested it using a browser and entering a test URL such as: http://192.168.1.111:8000/2020-02-09/test.jpg

However, that same URL will not load by Picasso. It will load local pictures via the "file://". As test, I have tested an internet URL and it also loads successfully. So I have narrowed down the problem to the LAN address.

I have tried the android:networkSecurityConfig solution but it did not work. I'm running out of ideas at this point and about to ditch Picasso and load the images via ftp but did not want to get into managing efficient memory management. Please advise...

Hong Son
  • 21
  • 2

1 Answers1

0

I spoke a bit too soon! I tried to bypass Picasso and use an asyncTask based on java.net.URL(lanUrl) and saw the error in the debug window: java.io.IOException: Cleartext HTTP traffic to 192.168.1.150 not permitted

So, that got me to Cleartext http traffic not permitted and revisit the networkSecurityConfig solution. Using the accepted answer, the error is now gone and Picasso loads successfully. I only wish it had produced that error message! Thanks goes to Shafi Muhammed.

Hong Son
  • 21
  • 2