We have moved to a new Sailfish OS Forum. Please start new discussions there.
7

How to develop cross platform applications?

asked 2019-06-19 20:00:43 +0300

jsommer gravatar image

Some developers of Sailfisgh OS apps probably face the same challenge to develop the apps for multiple platforms, especially Android. It seems to be possible to build and deploy Qt and QML apps for Android as well.

https://doc.qt.io/qt-5/android-getting-started.html

Unfortunately I have problems to setup Qt Creator for this purpose. I get the following error message:

/Users/marc/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld:
error: cannot find -lc++ clang++: error: linker command failed with
exit code 1 (use -v to see invocation) make: *** [libcalculator.so]
Error 1

Has someone experience in using Qt Creator for Android apps?

Anyway, what should be the approach to use Silica for Sailfish OS but pure Qt Quick Controlls for other Platforms like Android, UBports or even Nemo Mobile with shared code?

edit retag flag offensive close delete

Comments

maybe some inspiration at this example

rgrnetalk ( 2019-06-19 21:14:21 +0300 )edit

Awesome. Thanks.

jsommer ( 2019-06-19 21:18:21 +0300 )edit

3 Answers

Sort by » oldest newest most voted
6

answered 2019-06-25 02:03:32 +0300

MartinK gravatar image

I've faced the same challenge in the past, when moving from Maemo/MeeGo development to Sailfish and decided to use:

  • Qt/QML for the UI
    • Python 3 for the backend
    • PyOtherSide to hold it both together

There was still the issue of using a suitable QML component set, that looks as native as possible on every platform & is widely available. For this I wrote Universal Components:

It's basically a QML API abstraction layer that makes it possible to write cross platform QML UI code, that transparently uses Silica on Sailfish OS & QtQuick Controls 2 everywhere else as a backend to display the components.

The results are:

The modRana flexible navigation system

Runs on desktop Linux, Sailfish OS & Android.

The Tsubame flexible Twitter client

Still WiP, but runs on desktop Linux & Sailfish OS. Should work on Android as well once the non-trivial build machinery needed for that is setup.

And in any case, all the best in your development endeavors! :)

edit flag offensive delete publish link more

Comments

I need system ressources like contacts for my app. Android for Qt suggests a JNI interface to Java, but Felgo might be more confeient. I evaluate ut currently. My idea is to share the business logic of Sailfish and Android app and speed up the UI development, thst is similar but of course different because of Silica.

It is possible to have Sailfish look and feel without Silica? Does the operation system, automatically adopts the Sailfish look and feel to Qt Quick components?

You universal comonants seem very interesting. We also want to support pure Nemo Mobile. Will you continue the project for that purpose?

jsommer ( 2019-08-08 19:19:12 +0300 )edit
2

answered 2019-06-19 20:48:31 +0300

attah gravatar image

For your second question, this is an example: https://github.com/smurfy/fahrplan/tree/master/src/gui It appears to mostly share non-GUI code.

edit flag offensive delete publish link more

Comments

Thanks very much. I'll check out the project.

jsommer ( 2019-06-19 21:13:48 +0300 )edit
0

answered 2019-06-22 17:54:15 +0300

jsommer gravatar image

For the other problem I found a workaround in the Qt form. Its a bug, that should be fixed in one of the next Qt releases: https://forum.qt.io/topic/101322/what-s-the-problem-android-compile-error/12

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
5 followers

Stats

Asked: 2019-06-19 20:00:43 +0300

Seen: 667 times

Last updated: Jun 25 '19