Android Question How to design for a 1280x720 layout at start?

markcrhome

Member
Licensed User
Longtime User
Hi all,
I am converting a windows exe to work on a smart phone. The original app has been designed to run at 1024x768

The main window has many edit boxes and labels etc

I need to replicate this on a landscape mode but when i use the b4a designer it tells me i need to use something with scale 1, but the target device is a motorola moto G running 1280x720 and the test b4a app i wrote suggets it uses a scale of 2, but the designer says the following...

---------------------------
Basic4android
---------------------------
It is not recommended to create variants with scales different than 1.0.

Do you want to normalize the values and add the following equivalent variant: 640 x 360, scale = 1 (160 dpi)?
---------------------------
Yes No Cancel
---------------------------

If I design at 640x360 how can I fit all the controls in?
Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

markcrhome

Member
Licensed User
Longtime User
See this tutorial: http://www.b4x.com/android/forum/threads/supporting-multiple-screens-tips-and-best-practices.17647/

1280x720, scale = 2.0 is equivalent to 640x360, scale = 1.

Always use normalized resolutions (scale = 1).

A 4'' phone cannot have the exact same layout as a 15'' desktop screen. The actual number of pixels doesn't really matter.

So basically I just make the controls smaller to fit the 640 resolution, and they will expand to the larger resolution?
 
Upvote 0

markcrhome

Member
Licensed User
Longtime User
Not exactly. You should understand the meaning of the scale value.

For example, if you set a buttons width to 100 with the designer when scale = 1 then on your device the actual number of pixels will be 200. However the physical size of the button will be the same.

Still trying to understand that one...

The windows app is the following layout, and fills the clients computer screen as 1024x768

staffportal002.jpg

On my dev computer it doesnt, I don't want it to scale, just stay the designed size

staffportal003.jpg

So is it possible to define a layout that is 1280x720 to allow me to add the views at the actual size i want them to be shown?

I really don't want it to scale down for lower resolution screen as they are using a known screen size

P.S.

The scale factor of the moto g is 2, so how would i create a layout for that ?
 
Last edited:
Upvote 0

markcrhome

Member
Licensed User
Longtime User
You can create a variant with scale = 2. It is only a recommendation.

The layout you want to create will be unusable as it will be too small. However I'm sure that after some experiment you will better understand the scaling (dots per inch) concept.

Still blinking struggling to grasp scaling.

I have approx 70 controls to add to a panel, including labels and edittext boxes. I am used to WYSIWYG, so what I do in the designer is what i see on the screen, so truly lost here!
 
Upvote 0
Top