How to launch any app programmatically?

asked 2018-06-24 19:10:25 +0300

jsommer gravatar image

Do I necessarily need to import org.nemomobile.lipstick library?

If yes: How can I build an inblude the library in my project? I assume, that I have to build this project with a terminal command whithin the Sailfish platform SDK, haven't I?

If not: How can I start an app in QML respectively python? Is it possible to start an app with paramters? An example usecase could be to show a specific contact in the contact app or the messages with a specific contact in the messaging app.

edit retag flag offensive close delete

Comments

1

@jsommer

maybe, this might help.....I asked a similar question on TMO; http://talk.maemo.org/showthread.php?t=97662 please read the entire thread :)

One way was to employ dbus, this I found quite useful.

Spam Hunter ( 2018-06-24 20:14:13 +0300 )edit
1

Thanks for the linked diskussion. I conclude two approaches:

The first one is opening a file URL:

Qt.openUrlExternally("/usr/share/applications/jolla-clock.desktop")

For this approach I don't see a way to send parameters. The second approach uses Lipstick:

LauncherItem {
    id: jollaClock
    filePath: "/usr/share/applications/jolla-clock.desktop"
}

jollaClock.launchApplication()

Unfortunaltey I wasn't aple to import the Lipstick library in my project using Qt Creator of Sailfish OS SDK. The import statement in the Lipstick example project is the following:

import org.nemomobile.lipstick 0.1

I'm afraid, I have to build the lipstick project of mer-core and add it somehow to the project.

I'm indeed evalutation the Dbus API. I haven't found the apporproate service for launching apps, yet.

jsommer ( 2018-06-25 09:01:06 +0300 )edit