Frage

After driving myself mad for the past couple of days I have seen many different pages on StackOverflow, but not the answear I was looking for :(

I want to create a puzzle for an Android phone, or better: all android devices.

  1. Should i focus on making this app compatible with ALL android devices, including (really small) 2,7" and really large (7"+) devices? Or should I stick with an app that "looks good and works" on 3.2" till 4.7"?

  2. Bigger screens have more space, so the screen text can be bigger. How can I automatically have the app set the correct screen textsize? So far I have created the code below. Using sp for text size though it does not seem to do much.

  3. If you recommend me to make the app available for tablets, how can I set a max width for the buttons in the source below, but also have a minimum weight of lets say 90%?

    <Button
        android:id="@+id/BTN_StartGame"
        android:layout_width="250dp"
        android:layout_height="30dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:background="@drawable/mainbutton"
        android:text="@string/BTN_StartGame"
        android:textColor="@color/White"
        android:textSize="16sp" />
    
    <Button
        android:id="@+id/BTN_Settings"
        android:layout_width="250dp"
        android:layout_height="30dp"
        android:layout_marginTop="50dp"
        android:background="@drawable/mainbutton"
        android:text="@string/BTN_Settings"
        android:textColor="@color/White"
        android:textSize="16sp" />
    
    <Button
        android:id="@+id/BTN_Tutorial"
        android:layout_width="110dp"
        android:layout_height="30dp"
        android:layout_marginTop="100dp"
    
        android:background="@drawable/mainbutton"
        android:text="@string/BTN_Tutorial"
        android:textColor="@color/White"
        android:textSize="16sp" />
    
    <Button
        android:id="@+id/BTN_Rules"
        android:layout_width="110dp"
        android:layout_height="30dp"
        android:layout_marginTop="100dp"
        android:layout_alignParentRight="true"
        android:background="@drawable/mainbutton"
        android:text="@string/BTN_Rules"
        android:textColor="@color/White"
        android:textSize="16sp" />
    
    <Button
        android:id="@+id/BTN_About"
        android:layout_width="250dp"
        android:layout_height="30dp"
        android:layout_marginTop="230dp"
        android:background="@drawable/mainbutton"
        android:text="@string/BTN_About"
        android:textColor="@color/White"
        android:textSize="16sp" />
    

War es hilfreich?

Lösung

There are very different types of Android devices, from very small clocks (Motoactv) to large tablets like the Samsung Galaxy 10.1. In short, it does not make much sense to develop an application like your puzzle for all these very different devices. Why not choose the type of device which fits best with your gameplay mechanics and maybe develop another version for other device types with enhanced mechanics later? This way you could leverage the different characteristics to create a better user experience.

As for the "correct screen textsize", you could create multiple style.xml files for different screen sizes and define the appropriate text styles there. You can then create the required value-<screensize> folders and put those files in there accordingly. For more information read the Dev Guide on Providing Alternative Resources.

Hope this helps,

Don

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top