title: How can I emulate button elevation (shadow) in Android API lower than 21?
body: <p>I have this minimal Android Studio project with just a button.
  I assign the button a shadow with:</p>
  
  <pre><code>android:elevation="3dp"
  android:translationZ="3dp"
  android:stateListAnimator="@null"
  </code></pre>
  
  <p>and I see the shadow in Android Studio Design tab. But I also get a warning in the xml editor </p>
  
  <blockquote>
    <p><em>Atribute ... is only used in API level 21 and higher (current min is 16)</em></p>
  </blockquote>
  
  <p>And indeed, button shadow is displayed only in emulators with <code>API level 21 or higher</code>, and it is shown flat, with no shadow at all in emulators with <code>API level lower than 21</code>.</p>
  
  <p>So the concrete question is, how can I emulate the shadow effect in <code>API's lower than 21</code>.</p>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;LinearLayout
          android:id="@+id/main_layout"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:weightSum="1"&gt;
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_margin="20dp"
              android:layout_weight="2.24"&gt;
  
              &lt;Button
                  android:id="@+id/my_button"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_centerHorizontal="true"
                  android:layout_marginLeft="20dp"
                  android:layout_marginBottom="20dp"
                  android:elevation="5dp"
                  android:translationZ="5dp"
                  android:stateListAnimator="@null"
                  android:background="@android:color/holo_green_light"
                  android:text="BUTTON"/&gt;
  
          &lt;/RelativeLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
  }
  </code></pre>
  
  <p>Button showing shadow, in <code>API 22</code>:
  <a href="https://i.stack.imgur.com/NTUrt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NTUrt.png" alt="enter image description here"></a></p>
  
  <p>Same button not showing shadow, in <code>API 16</code>:
  <a href="https://i.stack.imgur.com/jSKKY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jSKKY.png" alt="enter image description here"></a></p>