Re: Mobile Device Physical Size

2017-10-21 Thread Richard Gaskin via use-livecode
Ignore my last post.  Garbage.  I had overlooked a rather obvious fact 
of screen manufacturing: each method will have slight variance in terms 
of absolute PPI, resulting in variance not only in physical pixelDensity 
differences but in how accurately the OS will bother to account for them 
in terms of the approximated logical pixels.


Screens aren't rulers. :)

When you look at devices with sufficiently different screens, you can 
see that common elements like the status bar are slightly different from 
one device to another.  LiveCode objects are no exception.  This can be 
seen with pretty much all software.


Near the beginning of the year when I was fleshing out layout mechanics 
for a couple apps I'm working on, I not only laid my test pool devices 
side by side, but also used a small mm ruler to see how consistently 
they render controls of a known size.


The variance I saw and measured was about the same as what we see here 
between OSes, not small enough to be completely inconsequential but not 
large enough to matter for most things.


As long as we don't try to make rulers on screen for measuring physical 
objects, we can likely account for reasonable object placement, even 
between platforms, well enough.


It would be interesting to learn if Apple devices have 
visible/measurable differences in physical size of software objects 
between screens made using different manufacturing methods.  But it does 
seem to be the case with Android.


--
 Richard Gaskin
 Fourth World Systems

Richard Gaskin had too much coffee when he wrote:
Thanks, Brian.  With your stats we now have our first anomaly, between 
the two platforms:


The iOS math checks out in terms of the reported logical metrics 
matching the physical pixels per the pixel density.


But when we compare the iPhone 5.5" screen with the LG Stylo 5.5" 
screen, LiveCode is telling us that the iPhone screen is both wider and 
taller. Of course given the same diagonal, one screen could be either 
wide or taller than the other, but not both.


This suggests that Apple's APIs and/or LC's handling of the metrics is 
sufficiently different from how it works with Android that we might run 
into cross-platform issues where physical size matters.


I wouldn't try to make a measuring ruler on a phone screen, but more 
practical use-cases might involve layouts that require us to put a lot 
of touchable areas into a small space, so figuring out the smallest 
practical size for a clickable element can be important.  Or even just 
making sure text is of a sufficiently readable size without making it 
larger than needed on the other platform.


If we set things up in a way that works well for Android, it seems we 
risk having things too small on iOS.


Of course both OSes use their own APIs, and neither is required to adopt 
another vendor's method of accounting for things like pixel density.


But it sure would be nice if we had a method as reliable between 
platforms as it seems to otherwise be within each platform.


Maybe simplest if LC's pixel density could take into account the 
difference there apparently is between the two OSes.  That's the sort of 
thing that makes a cross-platform tool valuable, though I recognize 
there may not be as simple as introducing a correction factor for pixel 
density; given the complexity of rendering/Skia, I suspect it's a bit 
more involved than that.


I guess the only solution where physical size of controls between 
platforms may be especially important is for us to just remember that 
regardless of any specific physical pixel density, logical pixels will 
be reported to us as about 20% larger on iOS than on Android, and try to 
aim for somewhere in between.


--
  Richard Gaskin


Brian Milby wrote:

 > iPhone6SPlus: 5.5" 1242x2208 414x736 414x736 3
 >
 > On Sat, Oct 21, 2017 at 3:54 PM, Richard Gaskin via use-livecode
 > wrote:
 >
 >> Yesterday, in reply to Ralph's post I included these notes about mobile
 >> metrics:
 >>
 >> > ...it seems that LC's resolution-independence works very much like
 >> > that of browsers (probably using the same OS APIs under the hood),
 >> > using logical metrics rather than physical.
 >> ...
 >> > I just ran a quick test to see how well that works:
 >> ...
 >> >   Diag  PhysicalWebLiveCode PxDensity
 >> >         -
 >> > LG G Stylo Phone: 5.5"  720x1280  360x592  360x592   2
 >> > Amazon F7 Tablet: 7.0"  600x1024  600x976  600x976   1
 >>
 >> This morning I had some testing to do so I charged a couple older
 >> devices and ran my test on each to get:
 >>
 >>   Samsung S4 Phone: 5.0"  1080x1920  360x640  360x640  3
 >>   Samsung S1 Phone: 4.0"   480x800   320x508* 320x534  1.5



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Re: Mobile Device Physical Size

2017-10-21 Thread Richard Gaskin via use-livecode
Thanks, Brian.  With your stats we now have our first anomaly, between 
the two platforms:


The iOS math checks out in terms of the reported logical metrics 
matching the physical pixels per the pixel density.


But when we compare the iPhone 5.5" screen with the LG Stylo 5.5" 
screen, LiveCode is telling us that the iPhone screen is both wider and 
taller. Of course given the same diagonal, one screen could be either 
wide or taller than the other, but not both.


This suggests that Apple's APIs and/or LC's handling of the metrics is 
sufficiently different from how it works with Android that we might run 
into cross-platform issues where physical size matters.


I wouldn't try to make a measuring ruler on a phone screen, but more 
practical use-cases might involve layouts that require us to put a lot 
of touchable areas into a small space, so figuring out the smallest 
practical size for a clickable element can be important.  Or even just 
making sure text is of a sufficiently readable size without making it 
larger than needed on the other platform.


If we set things up in a way that works well for Android, it seems we 
risk having things too small on iOS.


Of course both OSes use their own APIs, and neither is required to adopt 
another vendor's method of accounting for things like pixel density.


But it sure would be nice if we had a method as reliable between 
platforms as it seems to otherwise be within each platform.


Maybe simplest if LC's pixel density could take into account the 
difference there apparently is between the two OSes.  That's the sort of 
thing that makes a cross-platform tool valuable, though I recognize 
there may not be as simple as introducing a correction factor for pixel 
density; given the complexity of rendering/Skia, I suspect it's a bit 
more involved than that.


I guess the only solution where physical size of controls between 
platforms may be especially important is for us to just remember that 
regardless of any specific physical pixel density, logical pixels will 
be reported to us as about 20% larger on iOS than on Android, and try to 
aim for somewhere in between.


--
 Richard Gaskin


Brian Milby wrote:

> iPhone6SPlus: 5.5" 1242x2208 414x736 414x736 3
>
> On Sat, Oct 21, 2017 at 3:54 PM, Richard Gaskin via use-livecode
> wrote:
>
>> Yesterday, in reply to Ralph's post I included these notes about mobile
>> metrics:
>>
>> > ...it seems that LC's resolution-independence works very much like
>> > that of browsers (probably using the same OS APIs under the hood),
>> > using logical metrics rather than physical.
>> ...
>> > I just ran a quick test to see how well that works:
>> ...
>> >   Diag  PhysicalWebLiveCode PxDensity
>> >         -
>> > LG G Stylo Phone: 5.5"  720x1280  360x592  360x592   2
>> > Amazon F7 Tablet: 7.0"  600x1024  600x976  600x976   1
>>
>> This morning I had some testing to do so I charged a couple older
>> devices and ran my test on each to get:
>>
>>   Samsung S4 Phone: 5.0"  1080x1920  360x640  360x640  3
>>   Samsung S1 Phone: 4.0"   480x800   320x508* 320x534  1.5



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Mobile Device Physical Size

2017-10-21 Thread Brian Milby via use-livecode
iPhone6SPlus: 5.5" 1242x2208 414x736 414x736 3

On Sat, Oct 21, 2017 at 3:54 PM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Yesterday, in reply to Ralph's post I included these notes about mobile
> metrics:
>
> > ...it seems that LC's resolution-independence works very much like
> > that of browsers (probably using the same OS APIs under the hood),
> > using logical metrics rather than physical.
> ...
> > I just ran a quick test to see how well that works:
> ...
> >   Diag  PhysicalWebLiveCode PxDensity
> >         -
> > LG G Stylo Phone: 5.5"  720x1280  360x592  360x592   2
> > Amazon F7 Tablet: 7.0"  600x1024  600x976  600x976   1
>
> This morning I had some testing to do so I charged a couple older devices
> and ran my test on each to get:
>
>   Samsung S4 Phone: 5.0"  1080x1920  360x640  360x640  3
>   Samsung S1 Phone: 4.0"   480x800   320x508* 320x534  1.5
>
> So now we have data from four devices with very different specs:
> - four different resolutions
> - four different physical sizes
> - four different pixel densities
> - four different Android versions
> - three different vendors
>
> ...and in each case the screen metrics as understood by web browsers match
> those LiveCode gives us (with the one minor exception in the oldest phone,
> noted in the footnote below).
>
> It would be good to know if any of you testing with iOS devices get
> results that don't like up as well as these.
>
> But from what I've seen so far, on Android (and in my limited testing on
> iOS devices a few months ago) it looks like LC's resolution independence is
> very reliable for object placement across devices with very different
> display characteristics.
>
>
> * I don't believe there's a version of FireFox available now for a phone
> that old (I keep it in its original state with an older Android version for
> testing), so the web test used the browser Samsung included on those
> models.  The difference of 26p is likely a bug (maybe counting the status
> bar height twice?), one I've not seen in newer browsers.
>
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Mobile Device Physical Size

2017-10-21 Thread Richard Gaskin via use-livecode
Yesterday, in reply to Ralph's post I included these notes about mobile 
metrics:


> ...it seems that LC's resolution-independence works very much like
> that of browsers (probably using the same OS APIs under the hood),
> using logical metrics rather than physical.
...
> I just ran a quick test to see how well that works:
...
>   Diag  PhysicalWebLiveCode PxDensity
>         -
> LG G Stylo Phone: 5.5"  720x1280  360x592  360x592   2
> Amazon F7 Tablet: 7.0"  600x1024  600x976  600x976   1

This morning I had some testing to do so I charged a couple older 
devices and ran my test on each to get:


  Samsung S4 Phone: 5.0"  1080x1920  360x640  360x640  3
  Samsung S1 Phone: 4.0"   480x800   320x508* 320x534  1.5

So now we have data from four devices with very different specs:
- four different resolutions
- four different physical sizes
- four different pixel densities
- four different Android versions
- three different vendors

...and in each case the screen metrics as understood by web browsers 
match those LiveCode gives us (with the one minor exception in the 
oldest phone, noted in the footnote below).


It would be good to know if any of you testing with iOS devices get 
results that don't like up as well as these.


But from what I've seen so far, on Android (and in my limited testing on 
iOS devices a few months ago) it looks like LC's resolution independence 
is very reliable for object placement across devices with very different 
display characteristics.



* I don't believe there's a version of FireFox available now for a phone 
that old (I keep it in its original state with an older Android version 
for testing), so the web test used the browser Samsung included on those 
models.  The difference of 26p is likely a bug (maybe counting the 
status bar height twice?), one I've not seen in newer browsers.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Mobile Device Physical Size

2017-10-20 Thread Richard Gaskin via use-livecode

Thank you for bringing this to the list, Ralph:

> On Richards talk yesterday I brought this up and I am moving it to the
> list.
>
> Say you have 3 Android devices:
> 1) Phone sized.
> 2) Note sized.
> 3) Tablet sized.
> It is entirely possible that these 3 devices have the same(or close)
> number x/y of pixels.
> How can I determine the physical size of mobile devices? Web browsers
> are able to determine the device size or at least a phone vs. tablet.
> I would like to change the screen layout based on the physical size.
>
> I can determine a phone vs. tablet for Apple devices because of the
> limited number of iOS devices.

But we don't know what Apple will come up with next, so ideally what we 
use can accommodate all devices on both iOS and Android, without having 
to hard-wire values for any specific brand or model.


Earlier versions of LC may have been different, but in recent versions 
it seems that LC's resolution-independence works very much like that of 
browsers (probably using the same OS APIs under the hood), using logical 
metrics rather than physical.  This allows devs to place objects 
reliably across devices where physical pixel density may vary.


I just ran a quick test to see how well that works:

Right now I have only two devices from my test pool charged, but they 
make for a good comparison because their pixel density difference: a 
mid-range phone (LG G Stylo) and a super-cheap tablet (Amazon Fire 7; 
lists for $49, can find on sale now and then for $39 - great for 
testing).  Given the price difference between the two, it's not 
surprising that this tablet has such low pixel density compared to the 
phone which is both higher res and physically smaller.


To quickly assess browser metrics I went to WhatIsMyScreenResolution.com 
in Firefox on each device.  For LC I added a "Screen Size" button to a 
test app to display the last two items from the screenRect function, 
along with the value returned from mobilePixelDensity().


Here are the results:

  Diag  PhysicalWebLiveCode PxDensity
        -
LG G Stylo Phone: 5.5"  720x1280  360x592  360x592   2
Amazon F7 Tablet: 7.0"  600x1024  600x976* 600x976   1

This is awesome.  It looks like the core team's work on resolution 
independence has paid off handsomely for us:  we can use the same 
general layout strategies web devs use with Responsive Design, with good 
placement using logical coordinates that automatically account for 
differences in density.


This is also good for our development workflow: leave your stack 
resizable, and once you have your resizeStack handler written you can 
test your object placement for any size by just grabbing the stack 
window's corner and moving it around.


I don't have my iOS devices with me at the moment, but it would be 
helpful to learn if any of you see any differences between the logical 
pixels reported by browsers and those in LC on iOS.



* Note: If you use Amazon's pre-installed Silk browser the vertical size 
of the Fire 7 is shown as 1024; apparently Silk reports the full screen 
while Firefox and LiveCode subtract the height of the button row at the 
bottom of the screen (48px) to reflect only usable space.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Mobile Device Physical Size

2017-10-20 Thread Ralph DiMola via use-livecode
On Richards talk yesterday I brought this up and I am moving it to the list.

Say you have 3 Android devices:
1) Phone sized.
2) Note sized.
3) Tablet sized.
It is entirely possible that these 3 devices have the same(or close) number
x/y of pixels.
How can I determine the physical size of mobile devices? Web browsers are
able to determine the device size or at least a phone vs. tablet. I would
like to change the screen layout based on the physical size.

I can determine a phone vs. tablet for Apple devices because of the limited
number of iOS devices.


Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode