Screen Resolution of android
I am developing an android application for resolution 320x240. i want to use this same application for higher resolution is it 开发者_StackOverflow社区possible or i have to design UI for every resolution
Scale your application to be supported in different screen resolutions by following the guidelines at this link.
http://developer.android.com/guide/practices/screens_support.html#screen-independence
Mainly you have to use density index pixels(dp) as the unit to define size wherever you need rather than hardcoding with px
Android was designed to fit different resolution automatically. I would advice to read article from google about it.
You need not to use different layout for different resolution. What you need is just use three different resolution images of same name for all images and keep them in separate drawable folders(named drawable-hdpi,drawable-mdpi,drawable-ldpi) and also use screen width according to screen resolution whenever needed.For example :
int width=getWindowManager().getDefaultDisplay().getWidth() ;
gives you complete screen width.
For more details see Supporting Multiple Screens
Hope this will help you.
Make your design 'fluid' by avoiding e.g. AbsoluteLayout (see the documentation for details). Graphics should be provided for each resolution in the drawable-Xdpi folders.
精彩评论