Android Question question about design to multiple devices

Douglas Farias

Expert
Licensed User
Longtime User
hi i m making a app using the galaxy s3
my design is based on %x and %Y

using % is the best way to make design to any device?
i need make a design for tablets , pockets devices and more

can someone give me examples or the corret way to make this ajustable to all devices

using dip is good way or % ?


i try make with dip but it is ugly on tablets

and with % sometimes enlarges images

i see many tutorials here on the forum
but have tutorial using dip

have tutorial using %

i dont understand what i use to make app for all devices ?

on eclipse have x-large xx-large hdpi ldpi dont need make this on b4a too ?
 

Douglas Farias

Expert
Licensed User
Longtime User
i know and in all topics i dont have the correct response to make this *-*
 
Last edited:
Upvote 0

NJDude

Expert
Licensed User
Longtime User
To correctly size the layout you should use %, however, the problem that you might having is with AutoScaleAll, sometimes you don't have to use it, or just auto scale certain views.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
hmm i use this on all layouts
in my app have 5 - 6 layouts
i go remove auto scale
i dont understand for exemple
i make one action bar with panel
this panel is


''''''''''''design'''''''''''''''''''
AutoScaleAll
pnlAB.SetLeftAndRight(0%x, 100%x) OK this is ok on horizontal
pnlAB.SetTopAndBottom(0%y, 8%y)

this works fine on my device galaxy s3 s4 and on tablet
but on the pocket devices it is very very small realy bad in %y

for fix i make this
pnlAB.SetTopAndBottom(0%y, 45dip)
this works fine on pocket and on devices s3 s4 but on tablet it is small ¬¬

what i make on this case?

'''''''''''''''end''''''''''''''''''
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
The problem is that you are getting a little bit confused, if you use 8% on a large screen it will look fine because well, it's a larger screen, on a small screen will be indeed too small because it's proportional, in this case you should then use DIPs and assign a fixed size, AutoScaleAll will be appropriate in this case.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
hmm when i use dip to set vertical itens i need use AutoScaleAll ?
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Vertical or horizontal, it doesn't matter, you just have to test your layout and make sure scales correctly. You should also try the "Send to UI Cloud" so you can see how it looks on different devices, that's a designer's feature.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
What exactly do you expect ?
If you have screen sizes of 3.5'', 5', 7'' or 10'', this means that the 10'' screen is 2.8 times (linear) bigger than the 3.5'' screen.
For me, expecting to have a same layout for both screens (3.5'' and 10'') is non sense, anything that looks good on a small screen looks bad on a big screen and vice and versa.
So, finaly you must choose what you want to display on what screen.
One solution would be to have one layout set for screens up to 6'' and another layout set for screens bigger than 6''.
You can then load the relevant layouts according to the screen size.

Then when using %x, %y or dip values depends also on what you want.
If you want to have a view having the almost the same dimensons on every screen you should use dip values.
If you want to have the view dimensions proportionaly to the screen dimesions use %x and %y values.
The solution would be a mix of both, depending on what you want.
You may use ScrollViews to take into account the different Height/Width ratios.
You could use %x for horizontal scaling and dip values for vertical scaling in a ScrollView.

Unfortunately there is no universal nor magic method to cover all screen sizes.

One of my programs, I first wrote it for tablets only.
Then I wanted it also on smartphones and developed a specific application with its own layouts.
But, maintaining two applications is a nightmare so I merged both programs into one.
The principle is:
- screen orientatios: only portrait on smartphones and only landscape on tablets
- display one layout on the smartphones and two layouts side by side on tablets, using panels.
Your code needs to manage both sceen size layouts.
Finaly it was not that difficult.
I didn't use autoscale in this application, but used the DesignerScripts and anchors.
 
Upvote 0
Top