You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by After24 <vi...@after24.net> on 2016/12/08 10:05:29 UTC

Getting the exact screen density on AIR mobile

Hello,

I'm working on a project for which I need to get the exact screen density of
the device but Capabilities.screenDPI doesn't seems to return a precise
value. For example, the constructor specifications of my phone give 401 PPI
but Capabilities.screenDPI returns 480 PPI.

Does anyone knows if there is an ANE that provides a reliable screen density
value ?

Thank you.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Getting-the-exact-screen-density-on-AIR-mobile-tp14312.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Getting the exact screen density on AIR mobile

Posted by After24 <vi...@after24.net>.
Hello,

For those who are interested by this subject, I asked yesterday to Michael
Archbold from Distriqt if a would be possible to add this feature to their 
Application ANE
<http://airnativeextensions.com/extension/com.distriqt.Application>   and he
did it 3 hours later !

API is very simple :

/trace( "DISPLAY METRICS ========================" );
trace( "densityDpi:   " +
Application.service.device.displayMetrics.densityDpi );
trace( "screenHeight: " +
Application.service.device.displayMetrics.screenHeight );
trace( "screenWidth:  " +
Application.service.device.displayMetrics.screenWidth );
trace( "xdpi:         " + Application.service.device.displayMetrics.xdpi );
trace( "ydpi:         " + Application.service.device.displayMetrics.ydpi );
/

This will be super usefull for measuring screen elements accurately.

I highly recommand distriqt for the quality of their ANE and the
professionalism of the support they provide.

Vincent.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Getting-the-exact-screen-density-on-AIR-mobile-tp14312p14316.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Getting the exact screen density on AIR mobile

Posted by Vincent <vi...@after24.net>.
Hi,

Thank you. I will give it a try.


Le 08/12/2016 � 18:08, Clint M a �crit :
> Here's one for Android.  Shouldn't be too difficult to adapt for iOS and/or
> Desktop.
>
> https://github.com/SamYStudiO/flair-physical-density-ane
>
> On Thu, Dec 8, 2016 at 2:05 AM, After24 <vi...@after24.net> wrote:
>
>> Hello,
>>
>> I'm working on a project for which I need to get the exact screen density
>> of
>> the device but Capabilities.screenDPI doesn't seems to return a precise
>> value. For example, the constructor specifications of my phone give 401 PPI
>> but Capabilities.screenDPI returns 480 PPI.
>>
>> Does anyone knows if there is an ANE that provides a reliable screen
>> density
>> value ?
>>
>> Thank you.
>>
>>
>>
>> --
>> View this message in context: http://apache-flex-users.
>> 2333346.n4.nabble.com/Getting-the-exact-screen-density-on-
>> AIR-mobile-tp14312.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>>


Re: Getting the exact screen density on AIR mobile

Posted by Clint M <cm...@gmail.com>.
Here's one for Android.  Shouldn't be too difficult to adapt for iOS and/or
Desktop.

https://github.com/SamYStudiO/flair-physical-density-ane

On Thu, Dec 8, 2016 at 2:05 AM, After24 <vi...@after24.net> wrote:

> Hello,
>
> I'm working on a project for which I need to get the exact screen density
> of
> the device but Capabilities.screenDPI doesn't seems to return a precise
> value. For example, the constructor specifications of my phone give 401 PPI
> but Capabilities.screenDPI returns 480 PPI.
>
> Does anyone knows if there is an ANE that provides a reliable screen
> density
> value ?
>
> Thank you.
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Getting-the-exact-screen-density-on-
> AIR-mobile-tp14312.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>