Well, unfortunately i'm bumping on different screen sizes when my app is already finished and fully functional.
I found thousand answers about different devices/resolutions/dpi implementation and i tried to learn something from each one.
My goal is to NOT use different density folders but to resize/repositioning already existing pictures for each layout resolution/dpi. A little blur in pictures caused by resizing is at this time not important for me. My app is a school project and i need to start it within few days.
My idea is to create a giant set of layout folders like:
layout-normal-mdpi
layout-normal-hdpi
layout-normal-xhdpi
layout-normal-xxhdpi
layout-normal-xxxhdpi
layout-large-mdpi
layout-large-hdpi
layout-large-xhdpi
layout-large-xxhdpi
layout-large-xxxhdpi
layout-xlarge-mdpi
layout-xlarge-hdpi
layout-xlarge-xhdpi
layout-xlarge-xxhdpi
layout-xlarge-xxxhdpi
Copy/Paste my activities there and to set each activity object with a desired DP value to make the app usable/viewable on most devices.
After this i will create as more as possible virtual devices to test and edit graphics correctly.
Well again, what i'm losing by this way (except for quality DPI resolution)?
Have you a better idea to make my app compatible with most devices?
My app is targeting Tablets in most part and i would like to make it compatible to phones over 4inch as well.
Last question:
using the density value like me:
layout-normal -hdpi
is a good pratice? will it be implemented in future android releases? Or is better to avoid usind DPI values like:
layout-normal
Thanks a lot for any help.
This is a screenshot of my virtual device created as Galaxy S7 Edge. It loads itself the layout-normal-xxxhdpi layout.
I suggest you not to create all this layout, but to create different dimens.xml files, in this way you have to create only one layout, with one size attribute for each view, that Android takes automatically based on device screen dimensions. Here is an example:
LAYOUT:
<ImageView
android:id="@+id/image_cat"
android:layout_width="@dimen/width_category_image_carousel"
android:layout_height="0dp"
android:layout_weight="2"
android:foregroundGravity="center_horizontal|bottom" />
FILE DIMENS.XML for sw300dp (this indicate that smallest width, regardless orientation, must be 300dp)
<resources >
<dimen name="width_category_image_carousel">220dp</dimen>
</resources>
You have to create more files dimens.xml inside values directory in resources directory, based on different size screens you want to support. You can find more information about how to define different dimens here: https://developer.android.com/guide/practices/screens_support.html#NewQualifiers