Q:

How to set the book image with the background of bookshelf using android?

I want to display the each book front image with the background of bookshelf image in android program?
Background Image----> Bookshelf image
Foreground image------>Books Front page image
Xml File:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
     android:background="@drawable/iphone" >
</LinearLayout>

A:

I suggest you use Relative Layout instead. Then use Image View or Image Button and set the background of those Image Views or Image Buttons to the cover page of the book. With Relative Layouts, you can drag items with the click of your mouse and place them wherever you want on your layout. Use this to your advantage to place those Image Views or Image Buttons wherever you want and then set the individual backgrounds of the book covers. 
EDIT : Code Addition :
<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/relativeLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/iphone" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="36dp"
            android:layout_marginTop="58dp"
            android:src="@drawable/ic_launcher" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignTop="@+id/imageView1"
            android:layout_marginRight="72dp"
            android:src="@drawable/ic_launcher" />

        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/imageView2"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="46dp"
            android:src="@drawable/ic_launcher" />

        <ImageView
            android:id="@+id/imageView4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/imageView1"
            android:layout_below="@+id/imageView3"
            android:layout_marginTop="46dp"
            android:src="@drawable/ic_launcher" />

        <ImageView
            android:id="@+id/imageView5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignRight="@+id/imageView2"
            android:layout_centerVertical="true"
            android:src="@drawable/ic_launcher" />

    </RelativeLayout>

Perhaps something like this. But there will be few things that you'll need to change such as android:src="@drawable/ic_launcher" . I added ic_launcher lazily. So, you'll have to replace it with your book covers. Another thing you might have to change is re-positioning of Image Views. That's it I guess. Hope this helps. 

