I have a problem with the screen dimensions in android?

-1

I am developing an app, but I do not know how I can make it adapt to all the screens of the existing telephones, although it is programmed only to layout that my viewer of android studio, in this case the phone of 4 "by default , it looks good, but if this is tested on other external devices that do not match the same one of my android studio project, it is deformed, from this point, the appearance is already lost, how to make it adapt to all kinds of screen.

    
asked by Gean BCone Angulo 09.01.2017 в 05:11
source

2 answers

2

Maybe you should start with a tutorial or similar to get a general idea of how it is done. In this way, if in the future you still have any doubts, your doubts will be more specific and therefore easier to answer. You could start watching these 3 videos: link

    
answered by 09.01.2017 в 08:06
1

Assuming that you only have the activity_main in your layout folder, what you have to do is: Position yourself in this folder (layout) press the right mouse button and then go to New - > Layout resource file (and you click there) I'll list the steps better.

1) When the window opens: New Resource File, where it says: File name: there you write activity_main, the same name of your file that you have already created by default in your app. p>

2) without closing the window where you have written in the File name: activity_main see below: Available qualifiers: (in that box select the option "Size", it has a cross arrow from corner to corner)

3) Once you have chosen that option, between the two boxes you have arrows similar to these: > > (these arrows are used to add the different size options to your new activity_main) Press those arrows and you will see that it shows you on the right the screen options.

4) Once the arrows have been touched > > You will see that on your right you have in the Screen size area: the options, Small, Normal, Large, X-Large.

  • For each option you have to create an activity_main file, I mean: You can not add Small and Normal in the same file. You have to create 4 activity_main to be able to visualize your app in the different types of screen.

I hope it was helpful, greetings.

    
answered by 13.01.2018 в 19:59