Android Question Solved. Device LV Inconsistencies

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all.

Thank you in advance for any explanations you may provide.

CASE
3 tablets:
HP 21 1920 by 1080 scale 1 - LV Approximate size = 13.6+ 14+. Actual size: 21 inches
Asus TF103 1280 by 800 scale 1 - LV approximate size = 9.2. Actual size 10 inches
Dragon Touch 1280 by 800 scale 1 - LV Approximate size = 9.2. Actual size 8 inches

QUESTION
Is there a better way to calculate the approximate size of the device? The ASUS is the only one that gave a true approximate reading.

Best regards.

Sandy
 
Last edited:

tdocs2

Well-Known Member
Licensed User
Longtime User
Thanks, NJ.

I am getting mixed results. The HP went from 14 to 10... and it is 21.
Dragon Touch 1280 by 800 scale 1 - went from a 9.2 to 9.0. Actual size 8 inches

Let me test it thoroughly and post a better reply with screenshots (a pain to get on B4A Bridge - I have never ben able to connect via ADB after countless emails from HP).

I have an engagement and will not be back until late. I will be late.

c^2=a^2+b^2

normalize a and b... to get c

Sandy

PS: What - you memorized the entire contents of the forum or you have a great indexing system. (A short pencil is far better than a long memory...)
 
Last edited:
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, once more.

Detailed results testing DevicePhysicalSize

Methods:

Used approximate and exact - the same issues remain. The results are shown in screeshots below:


ASUS TF103.png Dragon Touch.png HP21.png

Screensizes Exact:


HP 21 1920 by 1080 scale 1 - LV Approximate size = 13.6+. Exactsize: 10+ .... Actual size: 21 inches - OFF
Asus TF103 1280 by 800 scale 1 - LV approximate size = 9.2. Exactsize: 9.88 .... Actual size 10 inches - very close if not exact.
Dragon Touch 1280 by 800 scale 1 - LV Approximate size = 9.2. Exactsize: 9.2 ... Actual size 8 inches OFF.

The app is attached.

Any insight will be appreciated.

Sandy
 

Attachments

  • 5 layoutValues.zip
    491.7 KB · Views: 233
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
What does 1920 x 1080, scale = 1 mean? It means that the device reported screen size is 1920 pixels * 1080 pixels and the scale is 160 pixels per inch.

So based on this the screen size is:
B4X:
Log(Sqrt(Power(1920 / 160, 2) + Power(1080 / 160, 2)))
This equals to 13.6 inch.

HP has decided to stretch the more or less standard tablet layout to a large screen. This is why it reports the wrong scale. The true scale is much lower.
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you, Erel, for taking the time to respond to my question.

However, using the code in THIS sub, Exactsize, the screen size in the HP21 is 10+ not even 13.6 (13.6 is obtained by lv.approximatesize).. The xdpi is 213 on the HP.

And I assure you, Erel, I am not foolish enough to be combative on this subject. Instead, I am struggling with it, since I clearly understand the premise of the pythagorean theorem on which this computation is based. There is a factor that I must be missing to normalize the size of the legs of the triangle. The issue not only happens on the HP21 which is an erratic device, and I have had problems with anchors in it, but it also happens on the 8 inch tablet, Dragon Touch, which reports Approximate size at 9.2 like the ASUS TF103, a 10 inch tablet. On Exactsize, the Dragon Touch (I have no idea why these names are chosen) is 9.2 while the ASUS TF103 is 9.88 (accurate).

I have almost become obsessed with ensuring that the app I am developing displays well as I was reminded by NJDude in another thread of the "1 star Ninja's" who are ruthless (as all who have published in Google Play and do not have a 5 star rating have experienced).

Any further insight would be appreciated.

Best regards.

Sandy

 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings.

I tested the app on 5 more devices and the results were perfectly accurate. I have added "Solved" to the thread title.

PROLOGUE

On the HP21, if you take the 13.6 inch approximate size and multiply it by [actual (xdpi or ydpi) / reported scale of 160)], the result, 18.3+ comes closer to the actual size of the screen.

So, if you want to get a more consistent reading, you may apply this factor.

The case for the Dragon Touch is interesting because it reports like a larger tablet, 9.2, but it also behaves like one.

MY CONCLUSION

The issue of developing for multiple screen sizes has been a bit overwhelming when compared to the Windows PC environment. As Google says, "Be together. Not the same." But I am firmly committed to development for Android as it is the dominant OS in the world. Couple that with the power of Google Play Marketing and it is a winning combination. Finally, add B4A to the mix and you have a winning formula.

MY APPRECIATION

Thank you, Erel, for B4A, and for all of your contributions to the forum. Thank you to all participants in the forum who freely give their wisdom and time to enrich this venue.

Sandy
 
Upvote 0
Top