Round corners on an Android ImageView

1. Create a new Android project in Eclipse or Android Studio.

2. In the /res/drawable folder, create a frame.xml file. In it, we define a simple rectangle with rounded corners and a transparent center.

frame.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
     <solid android:color="#00ffffff" />
     <padding android:left="6dp"
        android:top="6dp"
        android:right="6dp"
        android:bottom="6dp" />
     <corners android:radius="12dp" />
     <stroke android:width="6dp" android:color="#ffffffff" />
</shape> 

3. In the /res/drawable-xhdpi folder include the image you wish to use as the source for your ImageView.

4. In the /res/layout folder modify activity_main.xml. In it, you will see a LinearLayout that contains a standard ImageView, as well as a nested FrameLayout. The FrameLayout uses padding and the custom drawable to give the illusion of rounded corners.

activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_gravity="center"
    android:gravity="center" 
    android:background="#ffffffff">

    <ImageView
        android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:padding="6dp"
        android:src="@drawable/tr"/>
    
    <FrameLayout 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        
        <ImageView
            android:layout_width="match_parent"
	        android:layout_height="match_parent"
	        android:padding="6dp"
	        android:src="@drawable/tr"/>
        
        <ImageView 
	         android:src="@drawable/frame"
	         android:layout_width="match_parent"
	         android:layout_height="match_parent" />
        
    </FrameLayout>

</LinearLayout>