Application Development

From SailfishOS Documentation


Getting started

Getting started with the SDK is a fairly simple process:


Install

Download the latest SDK installers and install it. Read more about SDK Installation.

Run

Run the SDK and use it to create an application! The SDK comes with a handy SailfishOS application template that gives you a quick way to create your very first Sailfish OS application. Just go to File -> New File or Project in the IDE.


Read more about creating your First SDK Application


Explore

Learn about the building blocks of the Sailfish user interface with the documentation provided by our SDK.

Join the mailing list for updates and support.

Submit

When your app is ready bring it to the Harbour and we’ll make sure it’s working, compatible with Sailfish OS and help you launch it for Jolla device. After that you can follow the development on your dashboard and make any corrections.


Read more about Using Harbour


Software Development Kit

SailfishOS SDK is a collection of tools for developing SailfishOS applications. It includes:

  • Qt Creator integrated development environment (IDE)
  • Mer build engine for cross compilation
  • The SailfishOS Emulator
  • Tutorial, Design and API Documentation
  • Repositories for additional libraries and open source code


Qt Creator

Qt Creator is a cross platform integrated development environment (IDE) tailored to the needs of Qt developers. It has been extended to add support for Sailfish UI application development using Sailfish Silica components. It provides a sophisticated code editor with version control, project and build management system integration. More information on the IDE can be found at qt.io.


Mer build engine

The Mer build engine is a virtual machine (VM) containing the Mer development toolchains and tools. It also includes a SailfishOS target for building and running Sailfish and QML applications. The target is mounted as a shared folder to allow Qt Creator to access the compilation target. Additionally, your home directory is shared and mounted in the VM, thus giving access to your source code for compilation.


The build engine also supports additional build targets and cross-compilation toolchains. These can be managed from the SDK Control Centre interface within Qt Creator which allows toolchains, targets and even individual target packages to be added and removed.


Emulator

The emulator is an x86 VM image containing a stripped down version of the target device software. It emulates most of the functions of the target device running Sailfish operating system, such as gestures, task switching and ambience


Building blocks

A SailfishOS application takes advantage of the SailfishOS stack to allow rapid development of beautiful, content-rich applications which work flawlessly on a variety of different formfactors with minimal adjustment. This section describes the layers in the SailfishOS stack upon which applications are based.


Qt 5

Qt 5 is the latest major version of Qt. It enables developers to develop applications with intuitive user interfaces for multiple targets, faster than ever before. Qt 5 makes it easier to address the latest UI paradigm shifts that touch screens and tablets require. More info about Qt 5 can be found from Qt Project’s website.


Qt Quick2

Qt Quick 2 is next generation of Qt Quick being a high-level UI technology which allows developers and UI designers to work together to create animated, touch-enabled UIs and lightweight applications. More information is available in the Qt Quick2 documentation.


Wayland

In current release of SailfishOS uses Wayland instead of X11 in graphics pipeline giving improved user experience. SailfishOS is delivered with a fully functional compositor which takes care of window management and outputting graphics to screen. More information of Wayland can be found from Wayland homepage.


Sailfish Silica

Sailfish Silica is a QML module which provides Sailfish UI components for applications. Their look and feel fits with the Sailfish visual style and behavior and enables unique Sailfish UI application features, such as pulley menus and application covers. More information is available in Silica documentation.


Platform APIs

SailfishOS uses Mer, an openly developed and mobile optimized core, for the majority of its own core components. We provide you with a snapshot of the open source code utilized for this release at releases.sailfishos.org.


We are actively working to identify the set of platform APIs that we can officially support with compatibility promises. In the meantime you can experiment by extending the SailfishOS target in the SDK with development headers you are interested in.


Open source code

Naturally, we are providing the open source code used in this release. You can find this at releases.sailfishos.org. In the event the source code for a binary was not provided to you along with the binary, you may also receive a copy of the source code on physical media by submitting a written request to us. More information is available in the written offer for source code.


Sailfish OS Tutorials

In this section, you will find tutorials we have prepared for helping you in the development of SailfishOS applications. We will add more tutorials here as they become available.


Combining C++ with QML

QML is the preferred way of developing applications for Sailfish OS. However there are many cases where this is by itself not enough and dropping into native code is necessary. Common reasons include performance, utilizing existing C/C++ libraries and so on. This tutorial describes how to create an application that combines a QML frontend with a C++ backend. (Read more…)

Creating an application in Python

In addition to C++, Python is a fully supported language for developing Sailfish OS applications. It is especially suitable for those applications that have modest resource requirements. If your application does heavy duty processing we recommend using C++ instead of Python. In this tutorial we will create a simple Python app for displaying a list of colors. (Read more…)

Building packages manually

Sailfish OS provides a streamlined developer experience through the Sailfish IDE. At the moment it only provides for projects that are built with qmake. Some developers might also prefer to use a different editor environment. This document aims to describe the steps to build an application manually using the Sailfish OS build machine that comes with the SDK. (Read more…)

QML Live Coding With Qt QmlLive

Creating Qt Quick applications for Sailfish OS can be more effective with the help of Qt QmlLive tool from Qt Automotive Suite. Qt QmlLive supports live coding with two essential features. First it allows to distribute source code modifications, removing the need to redeploy your application to see the effect. Secondly it can instruct yor application which particular QML component should it load instead of the "main" one, so that each component can be worked on independently. (Read more...)

Guidelines

Coding Conventions

Sailfish applications are written in Qt and QML, and should follow Qt coding conventions. For more information see coding conventions page.

UI Definition of Done

UI Definition of Done is enforced for feature contributions made for the platform, but provides a good checklist for app development also.

Common Pitfalls

Common Pitfalls page lists common anti-patterns in Sailfish app development.

API Documentation

In this section, you will find relevant documentation that you can refer to when developing SailfishOS applications. We will add more API documentation here as they become available.


Sailfish Silica

The Sailfish SDK includes Sailfish Silica, a QML module for developing your own Sailfish applications. Sailfish applications are written with a combination of QML and C++ code. QML is a declarative language provided by the Qt framework that makes it easy to create stylish, custom user interfaces with smooth transitions and animations; a QML-based user interfaces can be connected to a C++ based application back-end that implements more complex application functionality or accesses third-party C++ libraries.


Read Silica API documentation for more information on how to develop Sailfish-style applications. Theme cheat sheet lists common color, margin, font and item size parameters used in Sailfish applications. Component cheat sheet displays short code examples how to use the most common Silica UI components.

libsailfishapp

To ease development of applications for Sailfish and to make sure paths for the applications are set correctly, and application startup time is accelerated, third party applications on Sailfish OS should use libsailfishapp. This library provides certain convenience functions to set up the project, install all files into the right directories, and get important paths at runtime via convenience methods.


Read libsailfishapp documentation for more information on how to use the library.

Sailfish Icon Reference

Sailfish icon packages provide hundreds of platform-style vector icons that can be used by Sailfish applications. The platform icons fall into five size categories: generic size variants small, medium and large, and special categories for cover action and notification icons. The icons are automatically scaled to target display dimensions and don't need to be resized by the app.


You can browse the available icons in the latest Sailfish Icon Reference documentation. Or print A3-size one pager to your wall.

Configuration Settings API

The Configuration module provides types to access configuration settings stored in DConf from QML. The types provide a property-based API supporting asynchronous reading and writing of configuration values and change notifications, enabling DConf to be used seamlessly within QML property bindings.


See Configuration API documentation for more information.


DBus API

The Nemo Mobile D-Bus QML Plugin allows you to access services on the system and session bus, as well as provide your own services. D-Bus is used for interprocess communication. Several system services expose an interface over D-Bus that can be used by third party software and other middleware.


See DBus API documentation for more information.


Notifications API

The QML Plugins Notifications QML Plugin provides C++ class and QML types allowing notifications to be published. A notification will have a specific category, and depending on its category will trigger a variety of graphical (banners, events-view popups, etc) and non-graphical (sounds and vibrations) feedback for the user.


See Notifications API documentation for more information.


Harbour

The Harbour is a curated repository of applications and other content for SailfishOS devices. It provides the backend for the SailfishOS Store and contains both commercial and free content (including apps, ambiences, and extension plugins) which are available for users of Sailfish OS devices.


Sailfish OS apps

When your app is ready bring it to the Harbour and we’ll make sure it’s working, compatible with Sailfish OS and help you launch it for Jolla device. After that you can follow the development on your dashboard and make any corrections.


It’s free to join and submit applications to Sailfish OS Store.


Submit a new app

Congratulations! You’ve worked hard and have an app that you hope is seaworthy. Tell us all about it and Harbour QA will inspect it to make sure there are no obvious problems – like a big hole in the hull! When we’re happy it’s all watertight, we’ll let you know and you’ll be ready for a launch party.


Monitor your app

Monitor downloads, likes, reviews simply and easily! Engaging with your user base is made easy with the Harbour dashboard.


Welcome to Jolla Harbour!