Meego Wiki
Views

SDK/Tablet/Tablet APIs/Sharing API

From MeeGo wiki
Jump to: navigation, search

Steps

  1. Setup your MeeGo development environment
    For tips on setting up a development environment for creating MeeGo applications, see your development Tablet SDK for Linux
  2. Install the meego-sharing plugin library and development package, and the various needed supporting packages in MeeGo
    Inside QEMU, on your MeeGo-based tablet, or in an ssh command-line, do the following:
    $ sudo zypper install libmeegosharingserviceplugin libmeegosharingserviceplugin-devel meego-sharing-devel qt-qmlviewer

Sample Code

The following sample plugin can be used as a reference. It implements two services - "foo" and "bar", and example custom QML UI for the service-specific sharing process.

  1. Download meego-sharing-examples-0.0.2.tar_.bzip2
  2. Unpack and Build the example plugin
    The source contains comments that help explain what is going on.
    $ tar xjvf meego-sharing-examples-0.0.2.tar_.bzip2
    $ cd meego-sharing-examples/example-plugin
    $ qmake
    $ make
    $ sudo make install
    
  3. If the meego-sharing daemon (/usr/bin/msd) is already running, you can either kill the daemon and restart it, or trigger the com.meego.meego_sharing_daemon/com/meego/meego_sharing_daemon/RescanPlugins DBUS call, which causes the daemon to reload all plugins, and load any new ones.
  4. Run the Sample viewing QML
    This will demonstrate the functionality of the example plugin and the service-specific QML UI code.
    $ cd meego-sharing-examples/viewer
    $ qmlviewer viewer.qml
    

Develop Your Own Plugin

Examine headers from libmeegosharingserviceplugin-devel in /usr/include/meego-sharing/plugin. You need to implement the interfaces in:

  • meegosharingservice.h
  • meegosharingserviceplugininterface.h

See the sample plugin code above for how to write your plugin. You will also need to provide service-specific QML UI files that finish any service-specific steps in the sharing process, such as collecting additional metadata for the shared files, or assigning service-specific attributes/parameters to the files, and then also trigger (or cancel) the actual sharing process in the plugin. For examples, see the files under the meego-sharing-examples/example-plugin/qml/ directory.

Personal tools