Google has shown some nice ways that elevation effect are shown on Lollipop here.
android:elevation=\"2dp\"
for buttons,
an
You can't mimic the elevation on pre-Lollipop with a official method.
You can use some drawables to make the shadow in your component. Google uses this way in CardView for example.
The ViewCompat.setElevation(View, int)
currently creates the shadow only on API21+. If you check the code behind, this method calls:
API 21+:
@Override
public void setElevation(View view, float elevation) {
ViewCompatLollipop.setElevation(view, elevation);
}
API < 21
@Override
public void setElevation(View view, float elevation) {
}