Friday, September 7, 2018

application development - How does one get the ambient light conditions in Ubuntu Touch?



I am planning to make an app which would switch between Light and Dark theme based on the ambient light conditions. So if it was a dark room, then the app would switch to a dark theme to reduce the strain on the eye and provide a pleasant experience.



I looked into Qt LightSensor API Docs here but on trying it on a sample device didnt work as expected. I also made sure to add sensors to the apparmor file. Has anyone got this working?



I would appreciate if the answer could include a working code.



It's indeed not yet hooked up to the backend yet (atm you can only get such sensor events using the platform-api directly). I included a story in the Phone Foundations backlog to hook this into Qt.



No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...