简体   繁体   中英

Android Different Screen Sizes

I'm working in Android Studio, this app is aiming to target devices from API 10, several features I am using for supporting old and new devices I am getting from appcompat library.

When I test in my phone, the app design seems Ok, but I know I have to mantain compatibility for other devices, like tablets. Untill now, I only have created folders in drawable, for different screen densities (mdpi, ldpi, xhdpi...).

The point is how can I support different sizes (ie one layout for small phones, other for tablets...). I heard about create folders in layout like small, medium and large, but in Google developers site, this is not recommended, I should use intead sw...dp, however it seems is supported only for api 13 and above.

I am considering make an app for phones and other for tablets, unless there is something I can do, keeping support for api 10 and above and supporting different screen sizes.

As you said, in the android documentation you can find ( http://developer.android.com/intl/es/guide/practices/screens_support.html ):

A set of four generalized sizes: small, normal, large, and xlarge Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.

It tells you to not use them just if you are designing for API 13 and above. If you don't then you should use the deprecated identifiers.

I don't think make an app for an API lower than 15 has much sense, here you can see some charts of API distribution: http://developer.android.com/intl/es/about/dashboards/index.html

With API 15 you are covering the 96.4% of the users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM