Content
Tizen enables you to search for content (images, videos, music or other) located on the local device storage. You can also perform content management tasks, such as viewing and updating content attributes.
The Content API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.
The main features of Content API include:
- Content retrieval
The Content API uses the same ContentManager interface instance (in mobile and wearable applications) for all content-related functionalities. The instance provides higher efficiency by performing batch operations on content items.
You can browse and search for content directories and content using the getDirectories() and find() methods of the ContentManager interface. When searching for content items, you can create attribute filters, attribute range filters, and composite filters based on specific filter attributes of the ContentManager interface. You can also sort the search results.
Note The batch mode does not provide progress information about operations. To ensure that you can view the progress, break the batch operation down into multiple smaller batch operations. For example, break down a batch of 100 update requests into 10 batch operations that update 10 records at a time. Breaking down a batch operation also helps you avoid blocking other database operations, such as add or remove. - Content management
You can view and edit content item details. The details are common file information and metadata attributes of the media file.
To view content item details, use the find() method. To update some attributes of a content item, for example its rating, use the update() method.
For more information on the content attributes, see the Content Full WebIDL Reference (in mobile and wearable applications).
If a content item is copied or moved, you cannot find it because a scan is not performed automatically. To retrieve the copied or moved item, use the find() method after calling the scanFile() method.
Note You can only view (and not update) the read-only attributes. - Content change notifications
You can keep the content in your application synchronized with an external content manager by receiving notifications in your application when the content changes. The setChangeListener() method of the ContentManager interface registers a change listener. You can use the ContentChangeCallback interface (in mobile and wearable applications) to define listener event handlers for receiving the notifications.
- Playlist management
Using the Playlist interface (in mobile and wearable applications), you can:
- Create playlists
You can create a new playlist and add items to it. You can also create a new playlist by copying the content of an existing playlist.
- Manage playlists
You can retrieve playlists and delete them.
- Manage playlist items
You can manage playlist items by adding and retrieving items, and changing the position of a single item or the order of all items.
- Create playlists