How we developed a mobile application on the Aurora OS (Sailfish Mobile OS RUS)

Our team has developed and supports a corporate mobile application for receiving payments within the framework of a payment system for a large customer. Now it is used by customer employees on devices running the Aurora operating system (formerly Sailfish Mobile OS RUS) in thirty-seven Russian regions. In this post I will briefly talk about this project and in more detail about the OS itself.









Background



Our company NORBIT has developed a payment system for one large customer. The system includes the server part and several clients: desktop, web and mobile application on the Android operating system. Initially, the system was implemented in several regions of the Russian Federation. In 2016, the customer decided to expand its regional presence, and at the moment the system is implemented and successfully operates in 37 regions.



In 2017, the customer decided to use the devices on domestic software and purchased several thousand INOI R7 devices with the Aurora OS (Sailfish Mobile OS RUS). Our team was tasked with creating another mobile payment system client.



The development took only a few months. It was an interesting challenge, as all the work had to be organized from scratch. We needed to assemble a team, build a process of development, testing and regular release of new versions. Iā€™ll briefly talk about these stages.









How was the project



To begin with, it was necessary to understand what forces to implement all this. We needed a team, but there were simply no ready-made specialists in the Aurora OS market.



Here we must pay tribute to the platform itself. Development under the Aurora OS is carried out using the Qt framework. And for writing simple applications, you can use the declarative language QML, which in most cases allows you to not resort to low-level programming in C ++. As a result, the task boiled down to the search for sensible developers for Qt, which, on the whole, are enough.



Ok, the team is formed, we need to catch up with the rest of the customers in terms of functionality. The deadlines were tight - we only had a couple of months to update the existing functionality and implement new features. On top of everything else, in addition to the battle with business logic, a battle with the platform itself awaited us. It was necessary to solve many questions, but we did not have ready-made answers to them. With stackoverflow, you wonā€™t copy the solution quickly, because the direction is new and we were one of the first. Here are just a few of them.



Bluetooth connectivity with KKM



The project required the support of cash registers (KKM) from ATOL and Shtrikh. Both KKM manufacturers produce products with the ability to connect via Bluetooth. Examples of working with Bluetooth can be found on the Qt website .



Barcode supplies a driver for working with KKM in the form of source code, which can be downloaded from the link . There is also a project example of using the driver.



The driver for ATOL can be downloaded from the site with the keywords for the search ā€œDrivers of commercial equipmentā€. In our project, we used the eighth version of the driver.



At the beginning of the project there were KKM both with support of 54-, and without. Therefore, support was required for four types of cash registers (ATOL / Barcode with 54- / without 54-).



Work with large database updates



Every morning, the customerā€™s employees update reference information on their counterparties on their phones. Since there are quite a lot of contractors (several thousand, depending on the region), updating the directories took up to 1 minute. Initially, commits were made after inserting each counterparty. After they began to make a commit after inserting all the help information, the time for updating the directories was halved (one big commit).



Application Build Optimization



At the beginning, ā€œchildren's mistakesā€ were made on the project - including header files in header files. The transition to forward declaration has significantly reduced the build time of the project. Also, it takes a lot of time to build and install a project to create an rpm package. If you select the installation type ā€œcopy binary filesā€, reassembling, installing and starting the project in debugging will take place in a matter of seconds. Also, for faster assembly on the emulator, you can disable the assembly of classes for working with barcodes and cash registers. The non-rpm installation option is potentially dangerous because dependencies will not pull up.



Automated build application



You can organize the assembly of the application without starting the development environment. If you build from the development environment, then in the assembly console you can see the running commands. The same commands can be run via bash or batch.



But despite all the difficulties, we completed the tasks set by the customer. On December 31, 2017, the application was successfully launched, and the first payments were accepted on it. At the moment, the application runs on several thousand mobile devices running the Aurora OS.



OS Aurora



Now let's talk more about the operating system and its features.









Aurora OS (formerly Sailfish Mobile OS RUS ) is a trusted operating system for mobile devices (smartphones and tablets). It is being developed by the Open Mobile Platform company. The system is based on the Sailfish OS platform and is designed for corporate users and government corporations.



In 2018, Rostelecom acquired 75% of the Open Mobile Platform company and a controlling stake in the Finnish project. At the same time, it was decided to replace the name Sailfish Mobile OS Rus with the Aurora operating system. This is better suited for the domestic market and, as conceived by the authors, corresponds to the goals of the product, and also causes positive associations both in Russia and abroad.



The word ā€œtrustedā€ means that an organization providing its employees with devices on the Aurora OS has full control over both the devices themselves and the data that they use. The security of data storage and transmission is ensured by encryption algorithms in accordance with GOST and is confirmed by certificates of the FSB and FSTEC .



To manage mobile devices, the SF Cloud product is also being developed by the Open Mobile Platform. This is a server solution that can be deployed on the equipment of the customer organization and allows you to monitor the status of employeeā€™s mobile devices at any time, install, update and remove applications on devices, manage OS updates, block access to the device, and safely delete data (wipe )









A full development cycle of the Aurora OS takes place in Russia. This allowed her to enter the Unified Register of Russian computer programs and databases. At the moment, this is the only mobile OS with this status, so compatibility with it is a prerequisite for mobile applications from the registry.



Under the hood of the Aurora OS is a POSIX-compatible environment. That is, it is full-fledged Linux for mobile devices. For example, unlike Android, out of the box there is systemd, D-Bus, ssh and other services and utilities familiar to ā€œlargeā€ distributions on a PC. At the same time, the system includes the libhybris component, intended for using drivers from the Bionic environment on POSIX-compatible systems. This allows you to run the Aurora OS on devices originally designed for Android. Including there is official support for the Sony Xperia X and Sony Xperia XA2.



Almost all the necessary APIs are provided using the Qt framework and additional libraries based on it, which are also used to implement system applications and services. The Qt license allows you to write both open applications and proprietary. In the second case, the essential requirement is compliance with the LGPL rules, but when using Qt libraries on a commercial basis, this requirement becomes optional.



Sailfish SDK is available publicly and is also focused on working with Qt. It includes the following components.



Qt Creator is an IDE developed by the Qt project and provides deep integration and tools for convenient work with Qt libraries. Sailfish Mobile OS RUS support is achieved through a plugin that configures the appropriate build kits for the ARM and x86 architectures and build and emulation controls.









The build environment is a Linux environment with a set of tools and goals , packaged in a virtual machine for VirtualBox. Distribution in this format allows you to use the same build tools, regardless of the operating system of the developer - Linux, Windows and macOS are supported, but it also imposes a number of limitations. For example, projects for the Aurora OS need to be placed in certain directories that are visible to the virtual machine: the user's home directory or an alternative directory specified when installing the SDK.



The emulator is a virtual machine for VirtualBox that includes a Sailfish OS image compiled for x86. In fact, this is a full assembly of the operating system, which allows you to check many aspects of the application. But at the same time, it is convenient to use physical devices to verify, for example, the use of sensors.



Qt QML Live is a tool that allows you to "change" the graphical interface of the application on the fly when making changes to the project's QML files without having to rebuild the installation package. This approach can significantly accelerate the development of the user interface.



Documentation is a set of reference articles covering both the description of the APIs provided by Qt and the components specific to the Aurora OS: for example, the Sailfish Silica documentation. The documentation is available for separate reading, and in the context help format called for the element selected in the source code editor.



To start developing applications for the Aurora OS, you can not only study the documentation, but also take training courses. There is a public introductory course on the Stepik platform that describes the first steps and the main aspects of development. Also, employees of the partners of the Open Mobile Platform company can, upon request at edu@omprussia.ru, get access to a more comprehensive training course, including, including lessons on the use of sensors, navigation, multimedia, etc.



The result of application development is the rpm installation package. Before he gets on the device employees of the customer company, he has to go through the following steps.



1. Signed with a valid developer certificate. In fact, this stage is an integral part of the installation package assembly, since not only the rpm file is signed, but also the files included in its composition. Availability allows you to check the origin of the installation package, as well as the integrity of its structure. To complete the signature, it is required to obtain key generation tools and a developer certificate; for this, partners of the Open Mobile Platform company can send appropriate requests to dev-support@omprussia.ru .



2. Transfer the installation package to the SF Cloud administrator. Depending on the organization of the workflow, this stage can be implemented in different ways. It is important that as a result, the package must be downloaded to the SF Cloud repository and be available for distribution to devices through the control panel. At the same time, when downloading to the repository, there is not only verification of the package signature, but also the correctness of the structure of the rpm file, which is subject to a number of requirements (due to both standardization of the location of application components and security requirements). For example:







To automate the verification of such requirements, use the rpm-validator script. A similar check is available in the SDK and can be called from the IDE in the Build Engine control center. It is important to clarify that the rpm-validator script settings may be determined by the target platform and customer requirements. You can get rpm-validator for certified builds of the Aurora OS in the "Open Mobile Platform" upon request at dev-support@omprussia.ru .



3. Distribution to devices of employees through the administration panel SF Cloud. This stage, as a rule, includes technical and functional testing on a small group of devices. When installing an rpm file on devices with a certified build of the Aurora OS, the signature and structure are also checked. Developers can be involved in fixing errors that occur before downloading all employees to devices.



Aurora OS remains the only mobile operating system that meets the requirements of the FSB and FSTEC.



We are ready in the comments to discuss the features of the development of mobile applications on the Aurora OS.



This article was prepared with the support of the Open Mobile Platform company



All Articles