Picasso image not displaying android - android

on my nodeJS server, i have an image that is displaying on web app however it can not be accesses from the android app using Picasso.
the url from the server is :
https://www.mesannuairesvideos.com/uploads/file-1491574016406.jpg
my code is :
Picasso.with(getApplicationContext())
.load("https://www.mesannuairesvideos.com/uploads/file-1491574016406.jpg")
.placeholder(R.drawable.real_madrid_tshirt)
.error(R.drawable.ic_profile)
.resize(250, 200)
.transform(new CircleTransform())
.into(imageView);
could anyone try to open it in an android test app please, I want to see if it can be included in an imageView on android application
any help would be appreciated. thanks

For what it's worth, I was having this issue and when I tried it on an actual device it was visible when it was not visible on the emulator.

your image cant be opened in browser neither maybe its your api-key or link

Related

Error 504 on loading a picture using Picasso

I'm trying to load a picture into CircleImageView from a URL which I get from an API call. The URL of the image is working when I paste it into the browser but Picasso is unable to load it into the view.
The image URL is an https URL. For some reason, I can't share the image URL.
If anyone has faced the same issue or know the solution to this please help.
Thanks
Since it seems that's a known issue of Picasso; if you are into Kotlin use Coil, otherwise Glide.

Did Facebook change something about profile images?

I'm using the Glide library for my Android app in which most users have connected their Facebook profile and are using their profile picture from Facebook as their profile picture on my app. Suddenly today, without having changed any of the code, all images from graph.facebook.com aren't loading correctly with the exception of Facebook's generic profile pictures (what you will see as your profile picture if you haven't yet uploaded one). When I take the URL for the images and paste it in my browser, the images are now being downloaded into a file rather than displayed on the screen like they were in the past. Again, the exception is a generic image which will simply display within my browser like I had been used to.
Does anyone know if there was a change made on Facebook's end and if so, where I could find some sort of documentation of this change? Of course, I'm in need of a solution for how to actually display the images like normal again as well.
Here is the code for how I'm loading the image using the Glide library:
Glide.with(activity)
.load(user.getProfileUrl())
.placeholder(R.mipmap.ic_profile_zero_state)
.bitmapTransform(new com.zensports.util.views.CircleTransform(activity))
.into(mProfileImage);
user.getProfileUrl() should return a URL like https://graph.facebook.com/1670580029918211/picture?width=700&height=700
Thanks in advance.

Images of a node server won't be shown in my app

I'm trying to open the following image in my android app using picasso for imageView, but it is not displaying:
https://www.mesannuairesvideos.com/uploads/file-1491574016406.jpg
However, i can open it from any browser (whether on mobile or on computer).
Am sure of my picasso method cuz it works perfectly with other urls, my problem is that images in that server are displayed on browsers and won't be shown in android applications.
Could anyone try to include this image in an android test application.
Can anyone test it for me please.That would be so helpful
Kowing that images are on a remote server.
Any help would be appreciated. thanks :)
The problem you're facing have to do with the part S from your protocol (i.e. httpS - the image you are trying to open is behind a secure connection). Picasso has a flaw dealing with secure connections. But you have workarounds. See this: https://github.com/square/picasso/issues/500
Not working for me too!
I using this code:
Picasso.with(context).load("https://www.mesannuairesvideos.com/uploads/file-1491574016406.jpg").placeholder(R.drawable.placeholder).into(holder.mPhoto);
I had this issue too. So this is how i have done
Node JS Code.
_app.get('/services/user/:photo, function(req, res){
consoles.log('Loading picture -> '+req.params.photo);
res.sendFile(_path.resolve('./upload/_profile/'+req.params.photo+'.jpg'));
console.log('./upload/_profile/'+req.params.photo+'.jpg');
});
Android code is here
Picasso.with(mContext).load(url).error(R.mipmap.ic_launcher_round).placeholder(R.mipmap.ic_launcher_round).into(viewHolder.icon);
Your url does not work try with this url https://netic-news.net/upload/_article/156.jpg
I'm waiting for your feedback!

How to load image from same url using glide or picasso in android?

Hi I have an wired issues stopping my development. I am working on the application similar to facebook having posts, comments likes and chat functionalities. In each functionality I need to load the user's profile picture. I can able to load the profile pictures when I was trying to login for the first time using glide libary. But when users changes the profile picture server is returning the same url but different image. How to invalidate or load image when it was updated and what are the best ways to handle this scenario?
Your answers are valuable to me. Thanks in advance.
like this:
Glide.with(MainActivity.this)
.load("URL")
.asBitmap().diskCacheStrategy(DiskCacheStrategy.SOURCE)
.placeholder(R.drawable.man_default)
.into(imgUserImage);
For Picasso you can use both MemoryPolicy and NetworkPolicy
Picasso
.with(context)
.load(url)
.memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE)
.networkPolicy(NetworkPolicy.NO_CACHE)
.into(imageViewFromNetwork);
refer this its well explained here!
I think disabling cache strategy will be helpful for you as your url is same so
DiskCacheStrategy.NONE
From Here
difference between the enum parameters for the .diskCacheStrategy() method:
DiskCacheStrategy.NONE caches nothing, as discussed
DiskCacheStrategy.SOURCE caches only the original full-resolution image. In our example above that would be the 1000x1000 pixel one
DiskCacheStrategy.RESULT caches only the final image, after reducing the resolution (and possibly transformations) (default behavior)
DiskCacheStrategy.ALL caches all versions of the image
try using:
Glide.with(context)
.load(url)
.placeholder(R.drawable.ic_profile)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.into(ivUserProfilePhoto);
here is a relevant Question
I am glad to give you suggestion over it.
First, you should remember every profile has unique URL and it should be immutable on the server.
These issue is more sort of on server side because you never know on client side when other users changed their profile pictures but server knows.
Probable solution we have done for it
Whenever any user changes in profile picture we saving these picture on server with his timestamp and it attached to it's URL.
eg : http://image.pngtimestamp=1336t78387
So, now you have different URL for the user profile you don't have to change it on client side.
Only thing you have to take care for it is how you will get these updated URL for the specific user.We are requesting for URL to server whenever we chat with other user or see his profile. so every time we get the latest pic.
Even you want to improve performance for it you can request for updated images URL at the start of your application when user launch app so server can return you all the images after given timestamp.
Hope these helps you.

android image not display with https protocol

Hi Friends I want your help to solve my issue if you have any idea please tell.
I want to show image on list view.When I use http protocol image display fine but when i use HTTPS image not display.
I used Picasso to display image on image view
Hear is my code what i used
Picasso.with(mContext).load("https://velocityagency.com/wp-content/uploads/2013/08/go.jpg").into(imgProduct);
thanks in advance
https://velocityagency.com/wp-content/uploads/2013/08/go.jpg
This is happening because the image URL is having a problem. Try to fix this issue first, then your image will load properly in android app

Categories

Resources