title: How to overlay a custom drawing over a SurfaceView being used as camera preview?
body: <p><strong><em>What I want:</em></strong></p>
  
  <p>I want to make a <code>Camera</code> Activity (i.e. an Activity which shows the Camera Preview) in which a square shape (<em>it's actually a bit complicated shape but I am saying square for simplicity</em>) is overlay-ed on the camera preview, so that the user knows where to position the camera such that a particular square shaped real object is positioned inside that square shape overlayed on the camera preview.</p>
  
  <p>Just like there is a face shape in the camera preview in the following image, so that the user can put their face there.</p>
  
  <p><a href="https://i.stack.imgur.com/bkq3V.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bkq3V.jpg" alt="enter image description here"></a></p>
  
  <p><strong><em>My Solution:</em></strong></p>
  
  <p>I thought of having a <code>FrameLayout</code> and then having <code>SurfaceView</code> for the camera preview and a <code>VectorDrawable</code> for the shape to be overlayed, as <code>FrameLayout</code> would Z-order its children such that <code>VectorDrawable</code> will end up being overlayed on <code>SurfaceView</code>.</p>
  
  <p><strong><em>Problems with it:</em></strong></p>
  
  <p>I need my app to be compatible with API 11 and above. So I'd have to use <code>VectorDrawableCompat</code>. To use <code>VectorDrawableCompat</code>, we need to set an AAPT flag. <strong><a href="https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#9513" rel="nofollow noreferrer">- source</a></strong></p>
  
  <p>The problem is that everywhere on the web, the way to set this flag is for Android Studio. (like the method described <a href="https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#9028" rel="nofollow noreferrer">here</a>) A few lines are to be added to the project's build.gradle file.</p>
  
  <p>I couldn't find out how to set this flag in Eclipse. I kept searching, and ended up installing the Eclipse Buildship plugin to use Gradle in Eclipse. I followed <a href="http://www.vogella.com/tutorials/EclipseGradle/article.html" rel="nofollow noreferrer">this guide</a>. When I added the Gradle nature to my Android project, I did get a <code>build.gradle</code> file. I pasted the code to enable that AAPT flag in it <strong>but it did not help my problem at all.</strong> </p>
  
  <p><strong>SO NOW I AM LOOKING FOR AN ALTERNATE METHOD TO ACHIEVE MY TASK. PLEASE TELL ME HOW CAN I DO IT, WITHOUT USING <code>VectorDrawableCompat</code>?</strong></p>