Android programming - screen resolution

I am new to Android programming. I saw different phones with different screen resolutions that run on Android. How to create an application that works on all Android devices without any distortion in the views of my application .....

+6
android resolution
source share
3 answers

The short answer is the size of all layout elements in dip . dip abbreviated for Density-independent pixel , and Android automatically scales elements of the same dip size on different screens. (You can shorten dip to dp in XML layout files.)

The long answer is to read this article on the Android developer website . It's long, but I highly recommend reading it from beginning to end at least once before you go too far with your application.

+6
source share

There are several ways to achieve screen independence.

  • Use 9 patch images where possible.
  • Design scheme using units of measure like dp, sp and measurements (in, mm ... etc.).
  • Use fill_parent and wrap_content where possible.
  • Use a resource with qualifiers (specify resources for a group / device type)
  • Design, scale, and install using custom coding for your program (not recommended) Read the following:

http://developer.android.com/guide/practices/screens_support.html (Take a better look at testing, best practices more sharply)

+3
source share

There are several guidelines for creating a permission-independent application,

  • Use all 9 patch images.
  • To create a layout according to a density-independent pixel.
+2
source share

All Articles