answered
2015-03-24 09:40:06 +0200
Just import Sailfish.Silica and Sailfish.TransferEngine, then show a ShareMethodList in a page in your application:
ShareMethodList {
anchors.fill: parent
header: PageHeader {
title: "Share All The Things!"
}
content: {
"name": "remote_filename",
"data": someByteArrayOrText,
"type": someMimeType, // eg "text/x-vnote"
"icon": someFileTypeIcon
}
filter: type // filter share plugins based on mime type
ViewPlaceholder {
enabled: methodlist.count == 0
text: "No sharing plugins installed which can share that mime type!"
}
}
Hope this helps!
For more information about the sharing engine stuff, see:
old: https://github.com/nemomobile/transfer-engine
new: https://git.merproject.org/mer-core/transfer-engine
But note that the code there is just the framework/engine, whereas the other two important parts (the share plugins and the sharing UI components) are closed source currently. Of course, anyone is welcome to write their own share plugins, and the UI components aren't black magic, they just call various methods of the sharing engine via DBus API.
Cheers,
Chris.