Since the beginning of my project I have been trying to show the images of the partners stored in a folder of the server of my database, and I have not succeeded until now
I have videos, manuals, searches and infinite websites, in all of them I see similar things, but in the vast majority those images are taken from the same website.
What I want is to take them from a shared PHOTO folder
I arrive at the server through a dynamic IP that we are going to assume is "mi_ip_dinamica.net" I use URL = "\mi_ip_dinamica.net\Equipo-BaseDatos\PHOTO" If I go to the network I see my computer and my shared folder, in location it says: \Team-Database, resource \PHOTO
I have tried several ways, this one with the picasso library
String extImg = ".jpg";
private String imageURL = "\my_ip_dynamic.net\Equipment-Database\PHOTO";
String nImage = methodGetImageNumber();
String rutaImg = imageURL + nImagen + extImg;
Picasso.with(this)
.load(rutaImg)
.error(R.drawable.avestruz)
.fit()
.centerInside()
.into(Cimagen);
In the GetImageNumber method, what I do is ask the database for the user number, the image of each user is stored named by that number.jpg
Could someone give me an idea? What am I doing wrong, what do I need to do, how could I redirect my project? Any help, please?
Thanks for the answer Jorgesys.
With dynamic ip, I mean the changeip.com server, that is, my public ip, which is dynamic, is linked to the changeip service, so it works as if it were a fixed static ip.
When you mention, in the imageURL string, this is where I'm missing something, I don't know if it's:
"https://mi_ip_dinamica.net/Equipo-BaseDatos/PHOTO";
either:
"https://mi_ip_dinamica.net/PHOTO";
Well, I have the folder shared and in the same folder it tells me that its network address is:
//equipoLocal/photo.
I also wouldn't know if I have to open specific ports on the router for picasso. I currently open port 136 for http:// or 445 for https://.
But I can't get it to work either way.
Another problem I see is that when I put the URI in the browser, it goes blank without loading any image
With the code you show there should be no problem loading the image from a url, ImgRoute should contain the url of the image:
If you are creating the image path like this:
first you must ensure to use the https protocol: in
private String imageURL = "https://mi_ip_dinamica.net/Equipo-BaseDatos/PHOTO";
then you must ensure that the value of
rutaImg
is a url that can be viewed when loaded in the device's browser .Here the problem I see is that when using a dynamic IP it may be that when you use the url the IP where the image is located no longer exists, it should be a fixed IP.