***Last updated on 11 May 2013 ***

Monday, 1 April 2013

How to insert a cool background in your android application

Well folks this tutorial is going to tell you as how you can get a cool background for your android app. The final product after this tutorial is going to look like this.
Step 1

Get a 400 X 600 image or crop an image of somewhat this dimension. Save it as a png format. In case you have a jpeg image convert it into a png. Edit it using paint and then save it as a png. The reason why I am focusing on png is that it is a standard image format.

You can download the background image that I have used from here : Background.png

Step 2

Save this image to the drawable-hdpi folder. See the screenshot below.

Step 3

Open the layout in which you want to insert the background image and add the following code in the layout

android:background="@drawable/bgimg"


And thats it you are done. Your final code should be like this.




Friends only have a look at the code that has to be inserted. I have used Android 4.2 here but that does not matters. In your android 2.2 development only add the "android:background" line to the respective layout. Any confusion or issues just comment here.

2 comments:

  1. I have completed this too, feed my hunger

    ReplyDelete
  2. New tutes coming soon..please share us on your social networking links..

    ReplyDelete