title: Dynamic readjustment of image size in ImageView in android
body: <p>I need to know how to go about resizing an image automatically on different screen sizes.</p>
  
  <p>I have an ImageView on my activity, and I've specified its <code>layout_height</code> and <code>layout_width</code> as 50dp each. Now I want the size of the image to upscale or downscale with respect to the screen dimensions/resolution of various devices, but it's displaying the image with the same size, thus looking too small in the tablet and just right in a cellphone.
  Moreover, if I use <code>wrap_content</code> instead for the width and height, it looks too big on the cellphone and just right on the tablet.</p>
  
  <p>So how do I go about fixing it?</p>
  
  <p>P.s. I've been using Android Emulator Nexus 4 (for the cellphone; 768x1280 xhdpi) and Nexus 9 (for the tablet; 2048x1563 xhdpi).</p>