Android Design Enhancement

I am working on an android application. I have to make my application compatible for the whole device. I know two ways. it

  • Creating section layouts for devices and tabs. For example, layout, layout, normal, large, etc. layout-sw600dp, layout-sw360dp and layout-sw720dp
  • Use one layout and use a different resource devble-ldpi, mdpi, hdpi, xhdpi for the device and drawable-large-mdpi and xlarge-mdpi for tablets.

Which way is better. Please give me an answer for some reason ...

+4
source share
3 answers

If your layout The design structure and orientation are the same for all screens, it is always best to use a single layout. Hope you already read this . But if your layout structure is different, there is no other way.

Even if you can use one-time resources for multiple screens, I think it's rates to use the sigle resources folder. Let's say for some images this will not harm you if the android automatically resizes the screen (for example, an image in full screen or images where stress is not a problem). In these cases, you can use these images only in the xhdpi folder

+1
source

These are both completely different approaches.

  • Different layout files should only be used if you want to create different views for different screen sizes. If your main view remains the same, it makes no sense to create separate layout files.
  • If your view remains the same, and there are only changes in the resource files, it would be more reasonable to make a separate folder with a choice for the devices for which you want to target.
+1
source

The second option is best if you need to make changes to the layout, you have to change it in several files. You may also have to use different styles for different device configurations. Even if you use the first option, you will have to save individual images in the drawble resource, for example drawble-ldpi, mdpi, hdpi, xhdpi. Use one layout and save multiple drawings and styles to support all device configurations.

+1
source

All Articles