Android Question Managing different screens res...

skipsy

Member
Licensed User
Longtime User
Hello,

I have already post about the same matter "Autoscale etc..."
I am trying here to explain a different way my troubles with screens size and resolution (rate ?).

I need to modify a program I wrote a couple of years ago for a very specific tablet (1024x600 dpi ??).
I want now this program to run on any tablet devices with higher resolution.

I still have B4A 3.0.

I thought : OK there is a magic designer instruction called "AutoscallAll"
BUT... This is working according to another one called "AutoScaleRate()"
If I set :
AutoScaleRate(0.6)
AutoscallAll for my old tablet
The displayed panel fill the screen
On a newer tablet (1024x800 150dpi) it does not fill the screen. I must change
AutoScaleRate(0.6) to AutoScaleRate(0.85)

Does it mean "Autoscall" works only for devices having the same dpi ?

Here attached th project I am working on as test.

I have also tried with the newest B4A trial, same problem.

Thanks for your remarks,
WW
 

Attachments

  • ajeter.zip
    422.5 KB · Views: 164

klaus

Expert
Licensed User
Longtime User
I had a look at your project.
The main problem is that you use a 320 * 480 portrait layout variant but you have views which seem to be in landscape mode and much bigger than the layout variant screen!? This wll never work with AutoScale-

In your other post with the same question you have two layout variants !?

So what exactly do you want to do ?
What are the dimensions and positions of the two views in the layout supposed to be according to the screen size ?

AutoScale is explained in detail in the B4A Beginner's Guide.
Originally, AutoScale could only upsize from the 'standard' layout variants to bigger screens.
In newer versions it can also downsize, but I don't remember since what version.

In the AutoScale the AutoScaleRate factor is a stretching factor.
AutoScaleRate(0) means no scaling and AutoScaleRate(1) is almost similar to %x and %y values.

You may also have a look at the AutoScale module.
 
Upvote 0

skipsy

Member
Licensed User
Longtime User
Thk you for helping Klaus.

In the other post, yes, I did some tests with differents variants and noticed NO CHANGE in my tablet neither on the virtual device.

I have copy/paste exemple from B4A Beginner's Guide (just changed the variant according to my second tablet) :
B4X:
delta = ((100%x + 100%y) / (1024dip + 800dip) - 1)
rate = 0.3 'value between 0 to 1.
scale = 1 + rate * delta
AutoScaleRate(scale)
AutoScaleAll
the result is that the panel is bigger than my screen !!

OK, let's try to understand another way. I have attached another zip. In the designer I have set a view perfectly fitting in with my old
tablet (variant 1024x600).
Question : How to make this view and his child button to fit in with any tablet having a bigger résolution ?

Sorry to bother you with things that sounds probably stupid on your side :rolleyes:

WW
 

Attachments

  • ajeter.zip
    13.1 KB · Views: 170
Upvote 0

skipsy

Member
Licensed User
Longtime User
OK Klaus, i am going to have a look on the code solution
Thks.
 
Upvote 0
Top