I'm working on an app that displays images stored in my personal Google Drive account in a public folder, and I access them and load into ImageView with the next url:
https://drive.google.com/uc?export=download&id=imageId
And so I use the next piece of code to load an image into an ImageView using Picasso:
String imageLink="https://drive.google.com/uc?export=download&id="+imageId;
ImageView imageView = (ImageView) findViewById(R.id.imageView);
Picasso.with(this).load(imageLink).into(imageView);
And it was working fine until yesterday, from when it started to work randomly, let's say, sometimes image is loaded and sometimes not and you simply see a blank ImageView (don't know the reason).
It's really weird, because when it stops working then it stops working for a while, and then, after many attempts it can suddenly start working again and so :s
I've also tried the next url with same results:
https://drive.google.com/uc?id=imageId
I guess it could be a better to implement Google Drive Rest API into my app, but I was reading the documentation and I don't find it trivial, so decided to give up.
I prefer to use just the url method because it's much simpler, but in case you think API is the only solution a working example would be much appreciated.
BTW; if I use the url in a browser the image is displayed/downloaded correctly, athought it is converted to something like this:
https://doc-0g-bs-docs.googleusercontent.com/docs/securesc/76n246a8a2lbkhsdab1lp67gphlf8cpm/i1ue4k811iltbcb797njulf061flfdpg/2581292320200/05260912172022660129/05860924272025660129/10_DnmLE22AvRB2eRHaTi8RLCrgVopoHC?authuser=0&nonce=2td2b6i2brn2u&user=02222914122025660129&hash=2odo2ssceotbocirunbn4vqj26l2h6fl
Any help?
Edit: I noted that Google Drive response is a plain http 403 error with no additional description (or at least Picasso Exception won't show additional data).
Edit1: I suspect it may have something to do with Internet connection. When it stops working (returning the 403) if I reboot my phone it starts working again (only with data connection, not with wifi). Maybe Google Drive is blocking my mobile connection ip after many requests (or at least is the only thing that come to my mind).
Edit2: Maybe it's only me that I'm doing many tests/requests from the same ip and that's why Google Drive blocks my ip or maybe it's a general issue and if plenty of users do requests at the same time the same will happen? I need to find a solution, and if there is no one (wouldn't believe that) at least advices on other free image hosting services I can use to load images in my app (into an ImageView) from the cloud.