Search code examples
javaandroidandroid-layoutandroid-gui

How to precislely place android GUI components for uniform display on most of the screen resolutions?


I am doing my beginner level android college project app,the backend progamming is finished,now I am trying to design the GUI using android studio,when I place a certain layout and run in the android emulator it looks good but when I runs it on real android phone the components messes up,is there any way or tool to perfectly place the android gui componenets ,so that they looks exactly and precisely the same as they looks on emulator.. please help,thanks


Solution

    1. There are many layout containers for android such as LinearLayout, CoordinateLayout, ... you can find docs here https://developer.android.com/guide/topics/ui/declaring-layout.html
    2. Use different Layouts depending on screen density of Screen Size docs https://developer.android.com/guide/practices/screens_support.html
    3. Use different dimensions for screen Sizes
    4. Avoid using RelativeLayout this will content messes up