-5

We make 5 types of layout for each and every Activity (ldpi, mdpi, hdpi, xhdpi, xxhdpi). For example, for login page we have 5 different layouts. If an application contains more activities, it takes more XML files simultaneously. For example, if an application contains 20 screens, we have to create 100 layouts. It takes more memory space to the application, more time and if we want to add a new attribute in a layout we have to change it in other layouts too.

How to make a single layout screen to fit for all (ldpi, mdpi, hdpi, xhdpi, xxhdpi) devices without changing anything while running the application?

Lamorak
  • 10,957
  • 9
  • 43
  • 57
Karthik . N
  • 45
  • 1
  • 6
  • 1
    what are differences in those layouts? – pskink Aug 18 '15 at 09:16
  • Ridiculous. You are not explaining a single thing about your app or the actual difficulties you're having with your layouts, it sounds like you have to do a job you don't want to/can't do, and you want us to do it for you based only on guesses ... That's not going to happen. – 2Dee Aug 18 '15 at 09:17
  • http://stackoverflow.com/a/6382201 – Sree Aug 18 '15 at 09:18
  • Not everything needs many layouts.. You just need a layouting technique and good knowledge of manipulating VIews inside a layout in the xml file. Note: Android gives you a very wide range of features... It's up to the programmer how he use it.. In short . . . . Study hard! – Sheychan Aug 18 '15 at 09:19

1 Answers1

0
  • Relative Layout gives you wide range of option for making your layout fit different type of screen/resolution...

And whenever you put your asset in project Android automatically takes the best resolution/size from respective folder.You just need to put your required media at where you want to be used(which is also optional... as android will auto generate there copies to respective folder).

Android also provides large number of internal device(emulator)

So i would suggest in place to using so many layout,Try using efficient code/layout and test it on different devices option you have...

Iamat8
  • 3,888
  • 9
  • 25
  • 35