Share API

Share API

Example of using Share API for Aurora OS.

Aurora OS Share API Example

Example of using Share API for Aurora OS.

To implement the example Share API documentation was used.

The application allows to share files with other applications and accept files from other applications. The supported file types are images and PDF-documents.

The main page of the application is a file list of the user file system. The user can navigate through directories and see images and PDF-documents. Files of other types are hidden. The context menu is invoked by long pressing on a file in the list and contains single item "Share". The "Share" item allows to open a system dialog for selecting an application or a device to share the file. Besides the application can accept files and information about them from other applications. To test this, invoke the "Share" context menu item in a side application and select "Aurora OS Share API Example" in the list of available applications. As the result the application "Aurora OS Share API Example" will be run. If it was already running it will be activated and the "Accepted files" page with information about the accepted files will be opened.

To implement the "Share" function the ShareAction component was used. Its using is described in the MainPage.qml file.

To implement accepting file from side applications the ShareProvider component and the description of an example of its implementation were used.

it is worth to pay attention on the specification of the ru.auroraos.ShareApi.desktop file on the X-Share-Methods, X-Maemo-Service, X-Maemo-Method fields and on the [X-Share Method ...] block specification. In the main() DBus-service registration was added. This is necessary to be able to activate the application. The ShareProvider components are declared in the ApplicationWindow and describe the onTriggered handler.

Build status:

  1. example - pipeline status
  2. dev - pipeline status

Terms of Use and Participation

The source code of the project is provided under the license, which allows its use in third-party applications.

The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.

Information about the contributors is specified in the AUTHORS file.

Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.

Project Structure

The project has a standard structure of an application based on C++ and QML for Aurora OS.

  • ru.auroraos.ShareApi.pro file describes the project structure for the qmake build system.
  • icons directory contains the application icons for different screen resolutions.
  • qml directory contains the QML source code and the UI resources.
    • cover directory contains the application cover implementations.
    • icons directory contains the additional custom UI icons.
    • pages directory contains the application pages.
    • ShareApi.qml file provides the application window implementation.
  • rpm directory contains the rpm-package build settings.
  • src directory contains the C++ source code.
  • translations directory contains the UI translation files.
  • ru.auroraos.ShareApi.desktop file defines the display and parameters for launching the application.

Compatibility

The project is compatible with all the current versions of the Aurora OS.

Screenshots

screenshots

This document in Russian / Перевод этого документа на русский язык