How to use an image in android application that is saved on a web server?

-1

I have an android application that selects an image of the SDCard and sends it to a webservice made in php that saves the image to a server and writes to the database (MySQL) the image path. What I wanted to do now is to take this image that is saved on the server and display it in that same android application. That is, make the reverse process of sending the image to the application. I have no idea how to do this, could anyone help me with this problem?

    
asked by anonymous 15.08.2017 / 21:39

1 answer

0

Just use libraries like Glide or Picasso. Ex (Glide):

Add these dependencies to your app/build.gradle file:

dependencies {
  compile 'com.github.bumptech.glide:glide:4.0.0'
  compile 'com.android.support:support-v4:25.3.1'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
}

And in the code make this call:

@Override public void onCreate(Bundle savedInstanceState) {
  ...
  ImageView imageView = (ImageView) findViewById(R.id.my_image_view);

  GlideApp.with(this).load("URL_DA_IMAGEM").into(imageView);
}

More details at: link

    
15.08.2017 / 21:49