Unifying cross-platform UIs

In our previous article, we discussed how agile, adaptable and future-proof development allows developers to manage multiple sources of data in today’s Internet of Things. Now, we’ll put those philosophies into practice with the development cross-platform user interfaces (UIs).

Engineering software projects are never simple, and they get very complex with embedded development. Developers must navigate around not only desktop, mobile and web applications, but also through several operating systems and various hardware specific aspects from screen resolutions and aspect ratios to hardware-specific drivers.

Developers who fail to efficiently navigate these will find themselves retracing their steps and delaying time to market. To avoid this, here are a few ways an application development framework helps developers build cross-platform applications.

Simplify and Streamline Development

There are three key criteria for successful cross-platform development:

Have an efficient, cost-effective way to write code

Have the ability to write, deploy, debug and test on different environments (hardware and operating system) at the same time

Maintain a fast time to market

Developers benefit greatly when they use cross-platform technologies such as Qt API’s, QML, HTML5 and others to meet these criteria. Cross-platform technologies enable developers to reuse code from one platform to another. This is especially the case when developers retarget their projects for embedded applications. In this case, the development target is an embedded device; however, this doesn’t mean that your development environment needs to be on an embedded device.

Cross-platform technologies allow developers to start with more user-friendly, common engineering environments (see Figure 1). For example, a developer can use a Windows PC to develop and compile app. Then, using cross-compiling/deployment tools, the developer can then compile and execute the source code for the embedded target. Long story short, this process only takes one code for one project with multiple different targets.

Figure 1: Cross-platform development enables developers to maintain a streamlined workflow while deployed to custom hardware (Source: The Qt Company).

Maintain Productivity Across Platforms

Cross-platform development is not a one-size-fits-all project. Different platforms – desktop, mobile, embedded – run on different resources. For example, embedded devices typically have hardware resource constraints. Meanwhile, on the other side of the spectrum, desktop applications have constant circuit power, big screens and – when compared to embedded applications, an almost endless amount of memory and CPU.

With that, embedded developers often find themselves in a tug-of-war between getting the best out of their embedded hardware and providing their UI designers a nice, easy-to-use technology for UI design. These two requirements prove very difficult to combine into one application, which then impedes productivity.

In an optimal solution, developers can mix and match C++ code with higher-level UI code to maintain device productivity and efficiency. Developers can bucket application logic, hardware-specific routines and other actions/activities that require a lot of CPU time into C++ and then mix that code with a higher-level UI language such as QML, JavaScript and HTML5 (see Figure 2).

Figure 2: Cross-platform technologies allow developers to develop applications in user-friendly environments before deploying them to a wide array of devices (Source: The Qt Company).

Developers have the full freedom to choose what technology and software architecture to use. However, developers who solely rely on higher level UI technologies such as HTML5 and JavaScript, may run into performance issues on limited hardware capacity or issues with managing and maintaining large code base over several releases. Have you ever tried to manage few hundred thousand lines of JavaScript code?