SailfishOS 应用开发

ref: https://sailfishos.org/develop/

Sailfish Silica

# pkcon install zypper

# zypper ar -f http://sailfish.openrepos.net/NielDK/personal-main.repo

# rpm --import http://sailfish.openrepos.net/openrepos.key

# zypper refresh

# zypper install wget

install google play

  1. Enable Jolla Developer Mode and allow SSH-connection.
  2. Download gapps-jb-20121011-signed.zip and extract it.
  3. Plug your Jolla with USB to computer in normal mode.
  4. Copy system-folder from your extract files to Jolla.
  5. Open SSH-connection to your phone and login.
  6. Write “devel-su” and press enter. After that, write your password.
  7. Write command: rsync -av –ignore-existing /home/nemo/system /opt/alien
  8. Reboot phone
  9. Install Google Play services to Jolla
  10. Install Google Play Store to Jolla
  11. Start Play Store and do updates.

连接MerSDK-SailfishOS-i486

ssh公钥连接 127.0.0.1:2222
username: root
pub: C:\\SailfishOS\vmshare\ssh\private_keys\engine\root

install python3

# zypper ar -f  http://repo.merproject.org/obs/mer-python3/latest_i486/ mer-python3
# zypper in python3-base
# zypper in python3-devel
# zypper in pyotherside-qml-plugin-python3-qt5

github example

Sailfish-Python

Python {
        id: python

        Component.onCompleted: {
            addImportPath(Qt.resolvedUrl('.'));
            setHandler('progress', function(ratio) {
                dlprogress.value = ratio;
            });
            setHandler('finished', function(newvalue) {
                page.downloading = false;
                mainLabel.text = 'Color is ' + newvalue + '.';
            });

            importModule('datadownloader', function () {});
        }

        function startDownload() {
            page.downloading = true;
            dlprogress.value = 0.0;
            call('datadownloader.downloader.download', function() {});
        }
    }

1. 主线程尽量避免慢操作,以免阻塞,建议使用asyncio

update os

$ devel-su               ## Use your SSH password here
# ssu release 2.1.0.11   ## Your target OS version - change if needed
# version --dup

update packages

# ssu status
# ssu domain
# ssu re
# ssu lr

# pkcon refresh -p -v
or
# zypper -v ref -f