title: Dynamically add views at xy positions in Android | Desk Booking
body: <p>I want to create something like in the attached image.</p>
  <p><a href="https://i.stack.imgur.com/FfqJ9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FfqJ9.png" alt="Desk booking &amp; placements" /></a></p>
  <p>Following are the operations that I want to perform:</p>
  <ol>
  <li>Show desks(seats) at particular positions in the app(resembling my office floor map).</li>
  <li>Show desk availability(blocked/available).</li>
  <li>Select a desk &amp; block it for some time.</li>
  </ol>
  <p>My Plan:</p>
  <ul>
  <li>Thought of dynamically adding images(seat/desk image) at XY positions in the screen so that I can resemble my office floor map.</li>
  <li>While adding the images I'll also create the click listeners so that I can perform actions when the user clicks on a particular image. And I'll use different images to indicate the desk is blocked or available.</li>
  </ul>
  <p>Problem:</p>
  <ul>
  <li>Tried adding <code>view/image</code> dynamically at XY position in <code>FrameLayout</code> but able to add only one view, getting an error if I try to add second <code>view</code>.</li>
  <li>Looked at this example <a href="https://github.com/varunjohn/Booking-Seats-Layout-Sample" rel="nofollow noreferrer">seat layout</a>, but with this can only add the views in linear order, can't place views at desired XY location.</li>
  </ul>
  <p>Is my approach correct? Any pointers/suggestions/info on achieving this will be helpful, thanks.</p>