Android: How to display IMAGE for Different screen resolutions/size programmatically
<p>I am going through the supporting Multiple Screens documentation on the Android and need some clarification.</p>

<p>It's my understanding that designing three unique interfaces (ldpi, mdpi, and hdpi) would be the best way to go about supporting all the potential android screens.</p>

<p>but i believe this would hold true when you do this while design time.</p>

<p>but if you create a view during run time programmatically and want to set background image then would the above hold true?</p>

<p>i am trying to draw a bitmap on a canvas using following,</p>

<p>canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.image_1), 0, 0, null);
in my custom view extending SurfaceView and then using this view in my main activity.</p>

<p>now i am using image_1.png which is 480*800 pixels using gimp.</p>

<p>if i use this image in the above code then it is not displaying correctly and the image appears bigger i.e. the image appears too big for the screen and hence not able to display the full content.</p>

<p>can you please advice what is the best approach to go on this?</p>

<p>thanks,
--ad</p>
