 OK. It's actually time for the next talk. We've got Sandro Andrade all the way from Brazil. He's also a KDEV board member. He's going to be talking about creating mobile applications with Qt about architecture and basic design decisions and frameworks to create mobile applications with Qt. So the stage is yours. Let's begin. All right. Good afternoon, everyone. So today I'm going to talk about architecture to Qt mobile applications. And this is the kind of subtitle we use to attract people to the talk. So frameworks called generators and beyond. So don't get disappointed. I promise to. I won't show anything very surprising. So yes. So a bit about myself. I work as a professor in the Federal Institute of Technology in Bahia, in Brazil, in the sunny city of Salvador. I've been developing with KDE and Qt since 2001, I guess. And also doing things for KDE since 2008. And I'm also in the board of directors of KDEV since two years ago. I'm doing some stuff in KDE at due, in particular our software for music education, which is Minuet. And I'm also one of the persons trying to push to move things forward for KDE and Qt in Brazil and in Latin America in general. So you should have heard already about our Latin American KDE desktop summit. And lately about Qt in Brazil. So brace yourselves. Maybe this is something you want to keep tuned about that. Maybe it's a conference where do you want to attend next year. If it happens again, hopefully it will. And so over the last one and a half year, we've been developing some Qt mobile projects in the university. I work at in collaboration with some local companies and also developing some Qt mobile applications for our own needs. And we need to have those applications running on Android and iOS. So we are, of course, using Qt to make that. So this is an application we are currently working on to manage our administrative, academic stuff, like taking student attendance and provide some particular communication channels for professors and students. This is another example which is already done. It's a mobile application for dealing with this kind of group buying like group on when you can get better geos if you buy things and in groups of people. So when going through this project, all of us already know that Qt provides a very rich and somehow mature framework to create mobile applications for at least the most popular platforms like Android and iOS. And so it can somehow keep things working pretty well across those platforms with some minor exceptions. But still, when you find yourself developing mobile applications which are large and complex, so you still need to come up with a good architecture to ensure that things can be easily maintained as the application grows over the time. So we don't have any beauty support in Qt to provide any sort of higher level framework to provide efficient architectures for mobile applications. And at the same time, we've seen that a lot of functionalities demanded by such applications are somehow recurrent. So we've seen a lot of applications which are a sort of clients server restful communication for doing all kinds of stuff. So this is the kind of thing that is quite amenable to have source code automatically generated to improve productivity and reduce bugs and so on. And so when doing this project, we have identified some Qt disabilities for developing mobile applications. Like as I mentioned before, the lack of a higher level architectural framework to keep, for example, new functionalities implemented as plug-ins we have a lot of functionalities for that in KDE frameworks 5. They are pretty awesome for doing that for desktop applications. But maybe in the mobile world, people usually don't want to have to deal with new dependencies or things that are hard to set up. And we also lack a set of reusable UI components. Kirigami is, of course, a good initiative with respect to that. But still, a lot of common user interfaces workflow can be designed as reusable components and have its development somehow automated by code generation. And also, we still have no built-in support for doing JSON-based restful communication in Qt. We have the XML list model QML object. But nowadays, we still need a sort of JSON list model to make things easier when doing client-server restful communication. Also, it has no built-in support for disconnected operations for those situations when you have no access to a network at that time. But you still want to use your mobile applications and have things synchronized once the connection is restablished. So implementing push notifications is also currently hard to do because you need some sort of platform-specific code if you are doing that in Android or in iOS. And also, we've been facing some issues when deploying and read-write files on Android. You have to put things on that assets directory and on iOS that works in a different way. So OK. So and then once we've identified these Qt disabilities, and we have been working over the last months in some solution which tries to mitigate the issues I'm bringing here. So we think that if you could somehow to come up with a nice reusable and modular reference architecture for mobile applications and then to turn that implementation in a set of templates and then use some code generation technique to provide to automatically generate some boilerplate code that would make Qt mobile development a lot of more productive, at least for those domains where such functionalities appear recurrently. And so that's how we decided to start working on MAG. We call it MAG, in the lack of a better name. So what's MAG, it's actually made of two different parts. So we designed it on a sort of linear architecture based on some dynamic KVML in order to have each functionality of the application implemented as a separated plugin. And then at runtime, those plugins are loaded. And in order to have, for example, the navigation menu and a lot of crud functionalities implemented already directly from such plugins. And then we come up with a set of templates with implement those core architecture and the plugins. And then we've been creating some code generator to allow us for developers to easily create new Qt mobile applications by using this reference architecture and this code generation. And so we have a command line interface, which is implemented based on RubyTor, which is a command line interface framework, which is used in Ruby on Rails framework. And so the templates are specified in Herb, which is also the template engine language used by Ruby on Rails. And generators are modular. So we wanted, since the beginning, to make it easy for developers to create new templates to implement new UI workflows or new client server communication. So we provide a JSON list model to handle JSON-based RESTful communication. And we have also some features to provide an automatic download of icons from Google material, icons to use then automatically in your Qt mobile applications. So currently we have some templates, which may be useful if you are developing Qt RESTful mobile applications. So we have some templates not only for the Qt client side, but also for the RESTful server side. So we have a template for creating a new RESTful server based on Sinatra. Sinatra is a micro framework for creating new RESTful servers in Ruby. And also we have another template to support new models and new services in the RESTful server you have just created. And we have a template for creating simple Qt mobile applications based on dynamic QML plugins. And also we have templates for creating Qt mobile applications with communicates with servers which provide RESTful services. So that's the time when I should provide you some demo. And maybe I will try to switch the microphones because I had to type. Hello? Yeah, can you hear me? Cool. And so this is how you can install Maggie currently. I want to do that here because I have it already installed. But you can clone the repository, install Ruby, run gem install bundler, and run the bundle to install all the required dependencies. And then you have the command line interface in the directory being Maggie. In the future, we can have a gem install Maggie. I'm not a Ruby specialist. I'm actually learning it while doing this kind of stuff. OK, so I have it installed here. So if you run being Maggie and help, so you have some description about the commands available. So if you want to create a new simple Qt application which already uses some QML plugins, you can just run this command. I have some script here. I will just copy it. And so here I'm saying Maggie, create a new project called simple application. And the type is simple app. So we have a set of templates. So here, you just pass the template you want to use when generating this project. So with that, you have a lot of boilerplate code already generated here. And now we can create a simple plugin for this application by running mag generate. You can just type help plugin. Then I can create a new plugin, call it and talks. We want to create some application for showing the academy program. And then here you can pass the path to the application you created before. So this is simple app. And I guess that's it. So with that, we have here in the folder plugins and a new plugin created for this application. Each plugin has a metadata JSON file which describe, for example, the name that will appear in the menu of the application and which QML file will be loaded when you click on that menu entry. So here we can already build and run this project. And here you have your simple application with a menu entry which was already collected from the installed plugins. When you click here, you have a hello from the talks plugin. And then you can just keep creating plugins. And those are automatically loaded with no need to rebuild your application. So this is our basic plugin. And OK. But we can also create some server-side and client-side plugins. So now I'm going to show you how we create a new RESTful server based on Ruby Sinatra. And so for that, we just need to run Maggie by passing a different project template. So now I'm saying just use the Sinatra server template. So I have a new project created here. And we can also create a new RESTful server plugin for that server. So this is a longer comment. Here I'm basically saying create a conference server-side plugin. The type of the template is Sinatra server-side plugin. And the application path where the plugin should be installed is my server. And here I can pass a set of the fields that should be stored at that server-side plugin. So if I want to store data about conference, so I'm storing the acronym and the name, the city, where the conference is happened, the venue, we start date and date. So with that, we create a plugin here. We can just run rake, the db migrate to create the database for this one. And I would now just to populate the database with some information. So I will add three conferences here. So we have Kitcom Brazil, Academy and ConfKD India. And I can finally start the server, my server here. OK. So with that, I have already a Racheful server running with automatically provide me a Racheful endpoint called conferences, where I can just try it here. So this is the answer. The Racheful server is providing. And OK, I will keep the server running at this tab. And now I will create a new project for the Qt mobile Racheful client for this server. For that, we will run again our client line interface to create the application called MyApplication by using the template Racheful application. And finally, I can ask it to create a new server-side plugin for Racheful communication. And this will be called conferences. I pass again the template I'm going to use to create the client-side plugin. And this is the name of the icon that should be used in the menu. So here, you pass the Google Material icon category and the icon name. And again, the set of fields that the server provides. Right? OK. So with that, I can just build the mobile application. So we can have it running. We have already conferences entry in the menu. And when you click here, it already makes a call to the Racheful server, gets our JSON back, and just provides this in a new list. When you click here, you can see the details for the conference. So we can easily create another plugin also for the server-side. And so let's create a new server-side plugin to store speakers now. And so with this, I will run rake db migrate again to update the database. And I will add some data regarding speakers here. OK. We have one speaker. Let's add another speaker. Cool. So I will just hashtag the server. Right? I will now create a new client-side plugin for that for showing also the speakers with that command line. OK. And now I can run again my app. No need to build it again, because they are key mail plugins. And if I run it here, we have a new entry, which shows also the speakers. Our beloved Konki and their gently. And OK. So going back to the presentation. So this is basically what we have so far. This is not intended to be a finished product yet. Just a set of thoughts and some preliminary prototype about how we can automate such development of Gitmobile applications. And so this is what I've just showed you. Right? So for the future, we plan to add some new templates for the full CRUD support to support the insertion and update and delete of that data directly from the mobile application. And we want to support some Kirigami-based templates. And also we want to support relationships between model to implement master details things and this kind of stuff which is quite needed in such a kind of application. Also, we want to support push notification by generating code-specific platform through this kind of tool. So if you want to try it, you are quite welcome to try to clone it, build, and just you can contribute with new templates or trying to automate more things. So just talk to me now or in the conference. So that is it. I don't know if we have time for questions. You have a question? Five minutes for questions. Any questions? Could someone? Boudain? Right. Thank you for the presentation. I have one question. Do you allow hierarchical-based templates? For example, speakers within conferences are like you presented one layer so the JSON content will have just one level. Is it possible to have multi-layered? Or you are thinking? Yeah, yeah, of course, this is possible. It's only a matter of creating a new template or a new application template which allows for a certain kind of stuff. Actually, that requires us implementing kind of relationships because conferences has speakers. The speakers has a lot of activities. I guess once these don't, we can easily make this possible, right? Thank you.