title: Android Changing image size depending on Screen Size?
body: <p>So I need to change the size of an image depending on the area of the screen.  The image will have to be half of the screen height, because otherwise it overlaps some text.</p>
  
  <p>So Height= 1/2 Screen Height.
  Width = Height*Aspect Ratio (Just trying to keep the aspect ratio the same)</p>
  
  <p>I found something that was:</p>
  
  <pre><code>Display myDisplay = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  int width =myDisplay.getWidth();
  int height=myDisplay.getHeight();
  </code></pre>
  
  <p>But how would I change image height in java? or even XML if possible? I can't seem to find a working answer.</p>