Neptune UI Application Development

When you are developing an application for Neptune UI, you must follow these rules:

  • The info.yaml manifest file needs to be under the application root folder. See Manifest File.
  • The name of the folder that contains info.yaml must be the same as the value of the id property in the info.yaml file.
  • Depending on your application type, either AppUIScreen or NavigationUIScreen must be the application root QML element. See Application Root QML Element.

It is important to follow all the defined rules in order for the application to become available in the system.

Manifest File

The manifest file must have the name info.yaml. The manifest file content should be as follows:

formatVersion: 1
formatType: am-application
---
id:      'com.pelagicore.temp'
icon:    'icon.png'
code:    'Main.qml'
runtime: 'qml'
name:
  en: 'Template'

categories: [ 'app' ]

For any additional information about the manifest file, please refer to Qt Application Manager Manifest File.

Application Root QML Element

The following table defines the application root QML elements that should be used when developing applications:

Root elementDescription
AppUIScreenCan be used in all kind of applications.
NavigationUIScreenUsed in a navigation application.

The following QML code demonstrates how to use AppUIScreen as a root element:

import QtQuick 2.6
import controls 1.0
import utils 1.0

AppUIScreen {
    id: root
    title: "Neptune Template"

    UIScreen {
        Content {
            anchors.centerIn: parent
            width: Style.hspan(13)
            height: Style.vspan(24)
        }

        onBackScreen: root.back()
    }
}

It is important to use the UIScreen component as a base. It provides a back arrow icon for exiting the application UI.

Interfaces

You can use the following interfaces in application development:

InterfaceDescription
NotificationInterfaceProvides an interface for requesting notifications. It uses the Notification component and is based on the org.freedesktop.Notifications D-Bus interface.
PopupInterfaceProvides an interface for requesting pop-ups. Both PopupInterface and NotificationInterface use the same D-Bus protocol.

Best Practices

When you are developing an automotive UI application with Qt Automotive Suite, it is recommended to follow the best practices:

  • Implement each visual part of the application (for example the application screen) in a separate, independent component.
  • Load UI components and a backend on demand when they are not visible or not needed in the device startup.
  • Separate the application logic from the visual UI components. Use models to store methods, properties, and a backend connection.

If you need to monitor an application startup performance, read the log output. The log title must have an application ID. The log content should be as follows:

== STARTUP TIMING REPORT: com.pelagicore.temp ==
0'020.000 entered main
0'115.359 after logging and qml register initialization
0'120.385 after application config initialization
0'127.403 after quick launch qml initialization
0'176.884 after application interface initialization
0'176.889 after dbus initialization
0'191.890 starting application
0'192.046 after loading plugins and import paths
0'974.908 after engine loading main qml file
0'974.914 after creating and setting application window
0'974.949 after showing application window
0'974.996 component loading and creating complete.

Note: The log output is available only in a multi-process mode when you have set the AM_STARTUP_TIMER value to 1.

You can add checkpoints to your QML code. The following example demonstrates how you can add a checkpoint to the application QML code when a plugin is loaded:

StartupTimer.checkpoint("plugin xxx loaded");
StartupTimer.createReport("Plugin xxx report");

© 2017 Pelagicore AG. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.