Recommendations for setting up a wide range of devices and screen sizes

As you know, today Android has many versions of many designers, many screen sizes, ...

Today, it’s quite difficult for developers to write programs that target most devices.

Why did you need to know the developer?

  • tips for fluid layouts.
  • "standards" for development on any version of Android.
  • ...

Any other ideas?

+3
source share
4 answers

For layouts

First, you should start reading the official Best Practices multi-screen support . There are many good tips, as well as a general idea of ​​what you need to look for in terms of compatibility.

, , , - . 1024x768 ( res)? , ? , / , .

layout_weight

android:layout_weight , . , , .

:

<LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <EditText android:layout_weight="80" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <Button android:layout_weight="20"
        android:text="Button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content />
</LinearLayout>

<EditText/> 80% , <Button/> 20% . , , , .

<include />

, <include layout="@layout/smaller_section" />. , (, ), .

+5

, :

  • SDK. 2.2, API 1.6 (touch wood), . , SD-, , .
  • , , . , , - .
  • , .

, - , . , -hpi, hdpi.

+1

, , . ( ) 100% .

:

  • ,
  • , ,
  • - , ( , )
  • , (.. google
    )
  • , (.. Blackberry
    jquery)
-1

, . :

<link rel="stylesheet" href="screen.css" media="screen"/>
<link rel="stylesheet" href="handheld.css" media="handheld"/>

, , . , "" , "" . , .

-1

Source: https://habr.com/ru/post/1762464/


All Articles