To distinguish between native Touch apps and non-Touch apps

Sep 29, 2015 04:00 GMT  ·  By

Canonical's Michael Terry sent an interesting email to the Ubuntu Touch mailing list to discuss the possibility of implementing a method for detecting native Ubuntu Touch apps and X-Ubuntu-Touch apps.

According to Mr. Terry, the new method will be used to distinguish between non-Ubuntu Touch apps and native Ubuntu Touch apps and needs to be implemented in the pocket desktop feature in order to apply separate lifecycle policies to those apps and warn users when the leave the pocket desktop mode so that they save their work.

At the moment, there are various non-Touch apps that don't have their state automatically when they're no longer in focus, such as LibreOffice, and it appears that, in theory, it's quite hard to detect if an app was designed for the Ubuntu Touch mobile operating system or not.

"Now, whether an app was built for Touch is kind of hard to detect in theory. Whether it talks the Mir protocol isn't sufficient (could be a GTK app with the Mir backend)," says Michael Terry. "Whether it is a click package isn't sufficient (some Touch apps like System Settings are debs). At least if it is an Xmir app instance, we know (those are all non-Touch)."

The ideal solution

Mr. Michael Terry thinks that the ideal solution to this problem would be to have a metadata flag, which will be used to indicate if an application was designed for Ubuntu Touch or not. It it's a native Ubuntu Touch, the Ubuntu Touch lifecycle handling will be automatically applied to it.

There appears to be a flag that fits the developer's ideal solution, X-Ubuntu-Touch=true, which is currently used in the unity-scope-click package to determine which Ubuntu Touch applications are displayed in the App Scope. We will keep you updated on the progress as it is made.