← Back to team overview

ubuntu-phone team mailing list archive

Re: Find out if running on a phone

 

Pardon my ignorance, buy can you not just check which codecs are
installed/in use and then make the right decisions based on that? It is a
really bad practice to write code that says "desktops be like this while
phones be like that" because you never know when one day a new device might
come along that shatters your expectations.

Feature detection > device detection
On Jan 10, 2016 7:58 PM, "Michi Henning" <michi.henning@xxxxxxxxxxxxx>
wrote:

>
> Right... forgot that it's a gerrit MR, not Launchpad:
>
> https://codereview.qt-project.org/#/c/101049/
>
>
> Thanks for that!
>
> I just had a look at
> https://codereview.qt-project.org/#/c/101049/15/src/systeminfo/qinputinfo.h
>
> But this requires an input to then find out what the source was (mouse,
> touch screen, etc.).
>
> I need to know whether I’m running on touch or on the desktop, without any
> input events.
>
> Any other ideas? Is there some place in the filesystem I could look at, or
> test some env var or whatever?
> It has to work under confinement though.
>
> Thanks,
>
> Michi.
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References