title: Setting the size and position of a Surface View
body: <p>I'm working on an interface where one half of the screen has edit text boxes for the user to enter data into, and the other half has a canvas that can be drawn to and reads user touches.</p>
  
  <p>Right now I'm extending a surface view and adding that to my layout(Layout is XML) at runtime with View.Addview.</p>
  
  <p>My problem is setting the size and position of the view. I want it to be square and take up about half of the screen (landscape). I want it to be aligned to the right side and either centered vertically, or aligned with the top.</p>
  
  <p>I can set the size by overriding the onMeasure method, but I don't know how to get the display size so I don't know what to set it to. </p>
  
  <p>I don't have any ideas about how to align the view, I've been trying adding it to various layouts without much luck...</p>
  
  <p>Thanks for any help!</p>