[Librem-5-dev] A few questions about development

Dorota Czaplejewicz dorota.czaplejewicz at puri.sm
Wed Jan 23 08:57:31 PST 2019


Hi Chris!

On Wed, 23 Jan 2019 09:34:10 -0700
Chris Hessing via Librem-5-dev <librem-5-dev at lists.community.puri.sm> wrote:

> Hello all,
> 
> 
> First, let me say that if I am posting this to the wrong list, please 
> let me know which list is the correct one to post to.   (I figured these 
> were development related questions, so they should go on the development 
> list.)
> 
> 
> I'm working on a TOTP app, primarily for the Librem 5, but one that can 
> also be used on Linux (and eventually possibly Mac, Windows, and maybe 
> even Android).   I have been developing it on Linux, and then building 
> and running it on the emulator to test. During that process, I've come 
> across some issues, and questions.
> 
> 
> If anyone has answers to any of these questions, please keep in mind 
> that I am developing this app using Qt, which might mean things are a 
> little different from an app developed using GTK.
> 
> So, on with the questions :
> 
> 1. Is there any good way to detect that the device the app is running on 
> is a Librem 5? --  I may be off about the intent here, but I suspect 
> that apps running on the Librem are expected to run full screen.  So, 
> being able to detect the device would allow me to put some special 
> Librem 5 code in to run the app fullscreen.

It shouldn't be needed at all, it's the compositor's job to understand whether applications should be full screened or not. All applications will be full screened with the final default Librem 5 compositor, and we're not planing to introduce non-full-screen mode for anything but dialogs so far.
> 
> 2. How are apps expected to terminate when running? --  I ran in to a 
> couple of problems that prompted this question.   First, when I built 
> the Qt app on the emulator and ran it, the title bar was tiny, and there 
> was no "X" button visible, so no obvious way to close the app.   Second, 
> when I added code to show the app full screen, Qt removes the title bar 
> completely, so again, there was no way to close the app.   If apps are 
> expected to be closed using the "X" button, I can change the way it goes 
> full screen to keep the title bar, but that just runs me in to the first 
> issue in this list.
> 
The answer to this question is related to the previous answer: the compositor is aware of the full screen status, and it will provide a way to close the application. You're seeing a missing X button because the compositor is not final, and I would count this as a bug.

> 2a. Is it expected that Qt developers will use the KDE Kirigami 
> framework (or some other framework) to make apps look/work properly on 
> the device?

That depends on how deep we go with the idea of "properly", but in general we want to support any kind of Qt applications. The details on what to use to make it look similar to GNOME apps are still being worked out.
> 
> 2b. If a specific framework is expected, can you provide any useful 
> links to examples of how to install it in a dev environment?   (Or, even 
> tell me if a certain Linux distro is a good one to use as it is easy to 
> set up the development environment.   When it comes to development 
> resources, I have a ton of hardware (and the power bill to prove it!), 
> but not a ton of time. ;)

As you mention later, we're continuously building our documentation here: https://developer.puri.sm/Librem5/Apps/index.html

PureOS is the distro we're focusing on, and we're documenting starting with GTK as the recommended framework. Time is indeed a scarce resource, especially with so many possible frameworks and languages users will want to program with, so if you can contribute your own findings, we're going to be grateful:

https://source.puri.sm/Librem5/developer.puri.sm/
> 
> 3. According to the developer documentation, apps can be distributed 
> either as flatpak or .deb packages.  The app I am working on will 
> require more components of Qt than what are installed on the emulator by 
> default.   If I package the app as a .deb, will the phone properly 
> handle asking for root permissions to install the extra packages?   Or 
> do I need to use a flatpak?   (I have no experience with either 
> packaging method, so I'd like to avoid learning one and finding out that 
> it won't work.   Right now, I am leaning towards creating a .deb as I 
> suspect there is more information available on how to do it.)

I would recommend using Flatpak, as this seems to be something we'll be supporting properly. If you want to have an early preview of what software installation will be like, give GNOME Software a try.
> 
> 4. After sliding up the key guard and entering the PIN, you are 
> presented with (on the emulator) a screen with a title bar, and some 
> buttons in the footer, but is otherwise blank.   Is the idea that apps 
> will show up on that screen?

Apps will present themselves similar to how they already do, try running the terminal to see.
> 
> 5. When installing an app, what should the app be doing to have its icon 
> show up in the appropriate place?

I take it that you mean the launcher. I think it needs a correct .desktop file.
> 
> Thanks!

Hope that helps, but don't hesitate to ask more questions!

Cheers,
Dorota
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.community.puri.sm/pipermail/librem-5-dev/attachments/20190123/aa3a0250/attachment-0001.sig>


More information about the Librem-5-dev mailing list