You can create this rectangle.xml file in the drawable folder in res folder:(Here colors are exactly how you want)
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" type="rectangle">
<gradient android:angle="90" android:startColor="#a3a3a3" android:centerColor="#cfcfcf" android:endColor="#f0f0f0"/>
now you can use it as a background of your screen by defining it in the style.xml file like this:
<style name="screenBackground">
<item name="android:paddingLeft">5dip</item>
<item name="android:paddingTop">2dip</item>
<item name="android:paddingRight">5dip</item>
<item name="android:paddingBottom">2dip</item>
<item name="android:background">@drawable/rectangle</item>
<item name="android:layout_marginBottom">15dp</item>
</style>
Now use it in your main.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:id="@+id/header"
android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android" style="@style/screenBackground">
// All your other elements in the xml file go here.
</LinearLayout>