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

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!

Related

URL encoder not working

I came across a weird situation. I am trying to a develop a android app which send the user entered data to the web server. I used HttpURLConnection and wrote code. It worked a few days. Now when I try to use that app it doesn't send the data if it contains spaces in between. Also if Genymotion emulator is used then it works fine even though spaces are given. I am not getting an idea of what the problem is. What should i do now??
you simply can't write a space directly in an url.
You have to encode it via %20 ... look here In a URL, should spaces be encoded using %20 or +?

Is it possible to load images in Picasso from non-standard URL's

I am trying to get Picasso to work with non-standard image URLs.
I am currently implementing this the following way:
String url = "http://someexampledomain.com/gallery.php?action=photo&phid=213"
Picasso.with(viewGroup.getContext()).load(url).placeholder(R.drawable.default_avatar_circular).error(R.drawable.default_avatar_circular).into(holder.postPhoto);
The above code results in the error placeholder image being loaded. (Please note that the link I have provided is a dummy link. I can't provide the actual link as it is a private API).
The following works however:
String url = "http://img4.wikia.nocookie.net/__cb20100125172609/starwars/images/thumb/f/f3/Yoda_naturist.jpg/200px-Yoda_naturist.jpg."
Picasso.with(viewGroup.getContext()).load(url).placeholder(R.drawable.default_avatar_circular).error(R.drawable.default_avatar_circular).into(holder.postPhoto);
I have not changed anything else, except the format of the URL. The first url works in my browser. Does Picasso not support URL's of the first type?
After some back and forth, the API dev and I realised that this could potentially be a server side authentication issue. After some investigation this proved to be the case.
Altering the request URL with the appropriate authentication credentials resulted in the image loading successfully via Picasso.
I thought I'd mention this here in the event someone else ran into a similar issue.

jsoup connect function doesnt fetch html code

I have implemented jsoup in android. Jsoup.connect() fetches the html content of a site "http://karnatakatourism.org/" correctly but it doesn't fetch anything for the url "http://karnatakatourism.org/Bidar/en/". I want to fetch the data from the links which are present in html page of www.karnatakatourism.org. Can anyone help me??
It seems that most of the content is loaded by some AJAX magic. You can try to analyze the network traffic to get to the URLs that you are really interested. These might be "getable" via JSoup.connect() then.
Another approach could be the use of other tools like selenium, but I don't know how far you can get with this on the android platform. Probably selendroid could provide your answer.

Phonegap android black external image

I'm new to android/phonegap development. I'm trying to access external images but I only get black places where the image should be on the emulator.If I try to open the html in chrome it displays the image. I already added the domain to the white list.
Would you be so kind as to help me figure out what the problem could be?
Thank you,
Henrik
Please check the case of the images names. See if the browser is also displaying the image or not
It was just an error of the emulator, when I tried on an actual device all worked fine!

Extracting image from html in Android

I am able to parse html content using HTMLCleaner & able to populate in list view. But extracting image I ma facing problem. while I am able to get images from any web server, i am not able to get same from my local Apache http server.
I want to know the reason & possible solution.
Thanks in advance.
It seems like the phone (emulator?) doesn't have access to your local server.
Use the browser in the phone/emulator and try to access your server just to make sure if it's this problem.
If you have access, print the url and make sure everything is alright.

Categories

Resources