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

How to implement a communication with apps and services?

asked 2018-05-11 19:02:41 +0300

jsommer gravatar image

For aprototype of a custom Sailfish UX I would like to implement an app that demonstrates system wide functions calls in the meaning of user interaction for creating and retrieving content. For this purpose I have some questions:

  1. Is it possible to launch other applications with parameters programmatically? If yes, how? For example a lipstick implementation or super app would open a specified message in the default email app.
  2. The D-Bus interface seems to enable retrieving content from system services like profiles, emails, contacts or any further data. Even updating data seems to be possible. The interface is technically documented, but where can I find the documentation of the available services, their methods and data model?
  3. How can I make a super app? It's just mentioned briefly in the documentation.
  4. By the way: I'm also still struggling with built and deploy the lipstick example as a template for customization. Does someone know any tutorial?
  5. How is it possible to define edge swipes? I think it is only possible within lipstick. But I realized, that the IRC app for Sailfish includes a kind of edge swipe althouth there are system wide definitions.

I admit, that these may be too much questions for one post, but they are connected.

edit retag flag offensive close delete

Comments

3

5: 'The IRC app for Sailfish' is free software, take a look at the source code and answer your question yourself.

nthn ( 2018-05-11 19:17:22 +0300 )edit
1

2: I'm afraid you have to dig out that yourself (= look at the code itself, it's hardly/badly documented...)

3: What do you mean by "super"? SUID apps?

takimata ( 2018-05-11 23:33:33 +0300 )edit
1

@takimata Super apps are mentioned in the linked Sailfish OS documentation and demonstrated with the Sailfish distribution of Intex Aqua Fish. The concept of super apps in Sailfish OS are selected, preferred apps, which are alwais available with an edge swipe from the right to the left like the notification center, that is available with an edge swipe from the left to the right. You even needn't open these apps with a selection in the app grid. I think it is also possible to define more than one super app.

jsommer ( 2018-05-12 00:09:53 +0300 )edit

@nthn Do you know, where the app ispublished? Of course I can search in Github and other sources, but maybe you already know the link.

jsommer ( 2018-05-12 00:11:11 +0300 )edit

i think there is nothing special bout suoer apps, take a look at schturmans paatch that did allow.to make any app a super app

pawel ( 2018-05-12 14:02:44 +0300 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2018-05-11 23:29:00 +0300

takimata gravatar image

updated 2018-05-12 19:10:33 +0300

Regarding 1.: Yes, it's a normal Linux after all. see https://linux.die.net/man/3/system and maybe https://stackoverflow.com/questions/33598606/system-calls-vs-c-c-system-calls#33598715

(afaik you have to use C/C++, no idea whether there's a way with QML)

edit: Maybe it's helpful to have a look at the list of available services with:

dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

and inspect interesting ones with sth. like

gdbus introspect --system --dest org.nemomobile.lipstick --object-path / --recurse

which, for example, tells you

node /com/jolla/Voicecall {
        interface org.bluez.VoiceCallAgent {
          methods:
            Dial(in  s number);
            Release();
          signals:
          properties:
        };
edit flag offensive delete publish link more

Comments

1

Sure, the core system is a Linux, but the documentation suggests, that the said services are part of a specific middleware:

"Sailfish OS comprises of a variety of middleware and application components; the main components are listed below. Many of these are built upon the Qt framework."

The documentation of the D-Bus for communication with the middleware services seems to be accessible via QML

"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."

I think, what I need is the DBusInterface, that is decribed by examples. I'm missing a documentation, how to get information about the available service, methods and data. Maybe there is shell command to list avalable services.

It would be grat to have something like the Script Editor app of macOS. With this app a developer can get a documentation of the scripting bridge of each selected applicatio, that provides this API.

Sometimes, developing for Sailfish OS seems to me like a detective job at Scottland Yard. This makes it the development very expensive. I wish, the Sailfish OS for developers would be well documented like the leading systems Android, Windows, macOS or iOS.

jsommer ( 2018-05-12 00:36:26 +0300 )edit

Only code is the truth ;-) But you are absolutely right, we severely lack documentation. I had to dig around at the mer-project's repos for my first application...

takimata ( 2018-05-12 19:14:08 +0300 )edit
0

answered 2018-06-24 14:21:37 +0300

jsommer gravatar image

Thanks for your help. Running the command, shows a long list of services. Unfortunately many of them are just named with the release number.

string "org.freedesktop.DBus"
  string "com.meego.usb_moded"
  string ":1.7"
  string "com.nokia.dsme"
  string ":1.8"
  string "com.nokia.SensorService"
  string ":1.9"

Do you or someine else how to find core content services?

  • calender
  • addressbook
  • messages
  • launching apps

Unfortunately there is no explicit API like in iOS or Android. I would prefer this not only for the convenience for development but also for security reasons. In LineageOS, partly in iOS and even in Stock Adnroid, the user has transparency and control, which services apps are using (of course not, what Apple and Google are doing,). Hopefully, there will be an explicit API in Sailfish 3, because Jolla announced sandboxing on an event this year. Otherwise there is a huge risk for privacy breaches and survaillance by installed apps.

The smart messaging agent seems to be the service for retrieving messages, doesn't it?

 node /commhistoryd/SmartMessagingAgent/ril_0 {
        ...
        interface org.freedesktop.DBus.Properties {
          methods:
            Get(in  s interface_name,
                in  s property_name,
                out v value);
            Set(in  s interface_name,
                in  s property_name,
                in  v value);
            @org.qtproject.QtDBus.QtTypeName.Out0("QVariantMap")
            GetAll(in  s interface_name,
                   out a{sv} values);
          signals:
            @org.qtproject.QtDBus.QtTypeName.Out1("QVariantMap")
            PropertiesChanged(s interface_name,
                              a{sv} changed_properties,
                              as invalidated_properties);
          properties:
        };

The GetAll methods looks promising. It seems it becomes a "detective job".

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

Question tools

Follow
4 followers

Stats

Asked: 2018-05-11 19:02:41 +0300

Seen: 468 times

Last updated: May 12 '18