Android Picasso not loading from LAN url - picasso

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...

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.

Related

importScripts in service worker

I am trying to use IndexedDB through Jakes Archibald's promise-based IDB lib by importScripts but as soon as I select "offline" through Chrome Dev Tools I am getting An unknown error occurred when fetching the script. A funny thing that's happening is that even if shut down my localhost server my app works fine (I have the browser cache disabled through Chrome Dev Tools) on my service worker installed browser but on another, of course, it doesn't.
I've looked into these https://www.w3.org/TR/service-workers/#importscripts, https://github.com/w3c/ServiceWorker/issues/106 resources but I didn't find an fix to my problem.
Any help/explanation would be greatly appreciated.
The problem is likely to be that you've not cached the idb.js file so that the service worker can access it when your app is offline.
Try adding it using cache.add (or cache.addAll if you are caching multiple files) inside your install callback.
Here is a library that i created. It makes using IndexedDB a whole lot easier! completely client-side, no dependencies!
https://github.com/ryanwaite28/promise-db

Google Colaboratory ServiceWorker Error On Chrome

Whenever I open a Colaboratory Document I always get the same error message:
NotSupportedError: Failed to register a ServiceWorker: The user denied permission to use Service Worker.
This is happening on chrome and my browser allows for ServiceWorkers (chrome://serviceworker-internals/), what's going on? Because the thing is all the code still runs.
Colab's output frames use service workers to support some functionality such as displaying richer graphs (Altair and Plot.ly).
The error message indicates that third-party cookies are disabled in your browser, this will prevent the browser service workers from working. The option should be configured under chrome://settings/content/cookies.
I tried white-listing in chrome link (chrome://settings/content/cookies) the following:
https://[*.]googleusercontent.com:443
[*.]colab.research.google.com
Here it was the best approach, better than simply liberatin the 3rd part cookies
Seems to work so on.
Usually there are two causes for this error:
1- you didn't allow cookies on colab domain, so you need to change you browser settings
2- you are using an adblocker

404 anomaly on one computer only

This is weird. On my personal computer at home when I type in my website, I get a 404 error.
No other computer gets the 404 error that I can see from several work computers to relatives, wife's laptop and even my phone using the same WIFI connection.
This only happened after switching my preferred domain under preferred hosting settings from www.xxx.com to xxx.com - perhaps coincidence, perhaps not.
I did this as links in Twitter and Facebook where directing to xxx.com and were giving me 404 errors. Note that the day I made the change the 404 errors went away and I was linking to my website. Then a day later, not working to access my website.
I would suspect nameservers etc but my computer is the only one seemingly exhibiting the problem.
I cleared the browser cache for Chrome and Edge still nothing. I downloaded FireFox and installed fresh and get the same 404 error.
I flushed the dns with ipconfig in administrator mode and it has been over 24 hours since the problem first occurred.
I can get to my website using the IP address fine. I can't using the URL, only on this computer. I even called GoDaddy to make sure it was only my machine and they say they see no problem.
The HOSTS file is virtually empty. and I can use the website with Visual Studio no problem.
Any thoughts? I am stumped on this anomaly.
Thanks again everyone! Your feedback helped me solve the problem. This project was originally started in PHP and moved to from Apache server to ASP.NET. My hosts file still had remnants to xxx.com being local, and not searching outside to the world. Removing 127.0.0.1 xxx.com solved the problem.
THANK YOU!

Ahoy_email gem : clicked_at, opened_at not getting updated?

I'm using ahoy_email ruby gem to track the emails I send. It should give me the time at when it is opened and clicked. But it's not working properly to give the time. What I'm missing.
Note: I run the project in my localhost
I had a similar issue. Make sure your server is accessible from the outside world so the image can be fetched.
A little background: I eventually figured that it worked from the godaddy webclient but not gmail, and thats because the webclient was just loading the image from my browser (so it could see my 'localhost'), but I believe gmail uses a proxy server to load images (https://filippo.io/how-the-new-gmail-image-proxy-works-and-what-does-this-mean-for-you/) so it couldn't find it.
I've been using ngrok lately to make my localhost outside accessible (temporarily!) and been liking it.

404 error when accessing Struts2 Web application

I had created a web application and committed the code in CVS. The web application is working good in my machine. When i tried to import the same code in another machine i am getting 404 error. I tried importing the code via ftp from my machine to another machine and also checking out the code from CVS. But still i get 404 error.
I also noticed that there is no error that had been captured in the console or in the application's log. Could someone help me in how to proceed further in identifying the issue. Please let me know if i need to post any further details regarding the issue.
I notice this issue to be in the Websphere server. I tried hosting the application in different machine and found that in few machine the same code is working good and some it is not. Is there any way to compare the server configuration?
In the WAS server 6.1 i added the below value in the web container and the application worked fine.
Steps:
In the server admin console, click on Application Server--> --> Web container--> custom properties.
Add the name as com.ibm.ws.webcontainer.invokefilterscompatibility and value as true.
Thank you all for the response.

Resources