-1

One of challenges in developing android applications is compatible app's UI with different screen sizes, Now i'm using smallest width in dimens and specifying sizes in DPand SPfor multiple devices for make my app UI compatible with diffrent screen sizes which solution is better than using smallest width to compatible app's UI or what is you solution for that?

Edalat Feizi
  • 1,371
  • 20
  • 32
  • Please check my this answer, you will get idea. https://stackoverflow.com/questions/49630287/android-layout-size-issue-when-changing-device-settings/49631729#49631729 – Khyati Chitroda Nov 26 '18 at 06:12

1 Answers1

0

I think, there are many ways to achieve this what i have learned in two years I can summarize here,

  • Use in-bulit width height - i.e. Match_parent and Wrap_content
  • For fixed width height - One can you Linear layout and divide it in screen %
  • If there are shape which need to be shown like circle or anything create layout, or instead of using images for gradient create them
  • Try to minimize use of images and incase use them, put all vectored images in respective folders.
  • For some layouts - Like showing circles overlapping as per width , try to do that programmatically where need to get height and width of screen and then need to lill bit of math to make it dynamic
  • Use dp for widgets and views height width parameter Use sp for fonts
  • Put all in style,dimen respective pages and use from there
  • There are many standard things which need to keep in mind while creating UI like heard size is 44dp etc. https://developer.android.com/guide/topics/ui/look-and-feel/

So its just matter of experience just avoid fix values and for even for simplest things google how other ppl have done it try to get their views and you're good to go.

Niki
  • 1,566
  • 1
  • 19
  • 36