Screen DPI ANE?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Screen DPI ANE?

bilbosax
My application is out of proof-of-concept and I am going to be writing the final version.  I want everything to be on point right out of the gate, and I need it to work on all devices reliably.  Laying out my components and scaling them correctly will be key, and this all depends on screen DPI, but unforunately, Capabilities.screenDPI is not a reliable way to get the correct DPI.  Does anyone know of an ANE that fairly reliably reports the correct DPI?  I have looked around, and remember reading about one somewhere, but I have been unable to find one.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

Josh Tynjala
The only time I've seen Capabilities.screenDPI report an unexpected value
was because the mobile device manufacturer actually chose the incorrect
value on purpose. It was a tablet and they wanted to scale apps to phone
resolution, for some reason. Once I knew that, the unexpected behavior I
was seeing made complete sense.

I've been using Capabilities.screenDPI for years, and I think you should
too because it actually works well. The reports of it being unreliable
are... unreliable. At least that's been my experience, and I've been
building AIR mobile apps since the beginning.

- Josh


On Mar 4, 2017 10:15 PM, "bilbosax" <[hidden email]> wrote:

My application is out of proof-of-concept and I am going to be writing the
final version.  I want everything to be on point right out of the gate, and
I need it to work on all devices reliably.  Laying out my components and
scaling them correctly will be key, and this all depends on screen DPI, but
unforunately, Capabilities.screenDPI is not a reliable way to get the
correct DPI.  Does anyone know of an ANE that fairly reliably reports the
correct DPI?  I have looked around, and remember reading about one
somewhere, but I have been unable to find one.

Thanks



--
View this message in context: http://apache-flex-users.
2333346.n4.nabble.com/Screen-DPI-ANE-tp14761.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

bilbosax
Thanks Josh.  I have been searching posts and blog articles about the unreliability of Capabilities.screenDPI, and I realized they were written way back in 2011.  Since I am not finding an ANE that was developed for this purpose, I have to assume it is because there is no need for one at this point.  I only have a Galaxy Tab, and iPad, and an iPhone to test with for my app, so I am grateful for the feedback from someone who has been doing this for years.  It looks like Capabilities is my best option.  Let me know if anyone else has differing opinions than this.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

Greg Dove
I've definitely seen this issue on android devices in the past, but I also
assume it may no longer be relevant in recent years.
We had an app that classified itself as either phone or tablet based on the
7 inch threshold, with different layouts etc, but calculating that from the
flash based api was not correct for all devices about 3-4 years ago (even
allowing a calculation range for variation :6.9 inches etc)

IIRC this definitely occurred on a 7 inch amazon Kindle device at one
point, I can't remember specifics about any others, it was quite some time
ago. At the time I made a homemade ANE to deal with it, and it is still in
current use in recent builds of the same app.



On Mon, Mar 6, 2017 at 8:14 AM, bilbosax <[hidden email]> wrote:

> Thanks Josh.  I have been searching posts and blog articles about the
> unreliability of Capabilities.screenDPI, and I realized they were written
> way back in 2011.  Since I am not finding an ANE that was developed for
> this
> purpose, I have to assume it is because there is no need for one at this
> point.  I only have a Galaxy Tab, and iPad, and an iPhone to test with for
> my app, so I am grateful for the feedback from someone who has been doing
> this for years.  It looks like Capabilities is my best option.  Let me know
> if anyone else has differing opinions than this.
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Screen-DPI-ANE-tp14761p14766.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

After24
In reply to this post by bilbosax
Hi,

The Application ANE from Distriqt has what you need :
https://airnativeextensions.com/extension/com.distriqt.Application

Cheers


Le 05/03/2017 à 20:14, bilbosax a écrit :

> Thanks Josh.  I have been searching posts and blog articles about the
> unreliability of Capabilities.screenDPI, and I realized they were written
> way back in 2011.  Since I am not finding an ANE that was developed for this
> purpose, I have to assume it is because there is no need for one at this
> point.  I only have a Galaxy Tab, and iPad, and an iPhone to test with for
> my app, so I am grateful for the feedback from someone who has been doing
> this for years.  It looks like Capabilities is my best option.  Let me know
> if anyone else has differing opinions than this.
>
>
>
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Screen-DPI-ANE-tp14761p14766.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

bilbosax
I guess the question now is, does Distriqt's ANE get the information in a different or more reliable way than Capabilities.screenDPI at this point?  If both get it from what the OS reports, then I doubt they will be any different.  Does anybody know? If not, I may have to contact them.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

bilbosax
Just found this on Distriqt's Application ANE site.

"The iOS screen density is determined from a lookup and is not provided by the API."

So, the OS is not tell the ANE what it's DPI is, the ANE is looking it up from a table.  This may be more accurate immediately, but I don't think it would be any good unless the ANE and your app on the App Store/Google Play were updated at least every 3-6 months.  I don't know about this approach.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

After24
Yes, DPI values are hard coded for ios but it's not a real issue since
Capabilities.screenDPI returns the correct values.
For Android, thought, the returned value is dynamic and seems to be
accurate (at least on the 6 android devices I tested)

But unless you want to make accurate on screen measures,
Capabilities.screenDPI should be sufficient.

Cheers.



Le 05/03/2017 à 22:55, bilbosax a écrit :

> Just found this on Distriqt's Application ANE site.
>
> "The iOS screen density is determined from a lookup and is not provided by
> the API."
>
> So, the OS is not tell the ANE what it's DPI is, the ANE is looking it up
> from a table.  This may be more accurate immediately, but I don't think it
> would be any good unless the ANE and your app on the App Store/Google Play
> were updated at least every 3-6 months.  I don't know about this approach.
>
>
>
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Screen-DPI-ANE-tp14761p14771.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Screen DPI ANE?

bilbosax
In reply to this post by Josh Tynjala
I have a followup question for all of you guys who do a lot of mobile development.  I am going to use CSS to scale the text for my app using @media queries.  Is there any reason to include CSS beyond DPI's of 160, 240, and 320? It looks like AIR will create DPI buckets from 120-640 DPI. Do you guys include CSS up to 640 DPI, or is this unnecessary? Are there currently any mobile devices that have that high of a DPI?
Loading...