This code snippet shows how to change the default rectangular shape of a view, in this case an EditText widget, by assigning to the background attribute an XML drawable shape file .
1. Save the XML drawable shape code to your Drawable folder.
round_rect_shape.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle" >
<solid android:color="#ffff" />
<corners android:radius="3dp" />
<stroke android:width="5px" />
</shape>
2. In your XML layout, assign the EditText background attribute the path to the round_rect_shape.xml file.
android:background="@drawable/round_rect_shape"
Note:
http://developer.android.com/guide/topics/resources/drawable-resource.html