The Sticker Provider sample application demonstrates how to insert the sticker data to the sticker database.
This sample application has no user interface. When the application is installed, the stickers that you want to save are automatically inserted into the sticker database.
Prerequisites
To ensure proper application execution, the following category must be included in your tizen-manifest.xml file:
<category name="http://tizen.org/category/sticker"/>
Implementation
To insert sticker data, follow these steps:
- Create the JSON file containing sticker data.
The following code shows the format of the JSON file used to insert sticker data:
{ "sticker": [ { "type" : 1, // Sets the URI type of the sticker "uri" : "/res/face/heart_eyes.png", // Sets the URI of the sticker "keyword" : ["face", "love", "adoration"], // Sets the keyword of the sticker "group" : "face", // Sets the group name of the sticker "thumbnail" : "", // Sets the thumbnail local path of the sticker "description" : "A yellow face with an open smile, sometimes showing teeth, and red, cartoon-styled hearts for eyes." // Sets the description of the sticker }, { "type" : 1, "uri" : "/res/face/sleeping_face.png", "keyword" : ["face", "Zzz", "sleep"], "group" : "face", "thumbnail" : "", "description" : "A yellow face with eyes closed and mouth letting out three, cartoon-styled Zzz’s overhead to indicate it's sound asleep." }, ..... { "type" : 1, "uri" : "/res/symbols/blue_heart.png", "keyword" : ["heart", "blue heart"], "group" : "heart", "thumbnail" : "", "description" : "A blue heart emoji." }, { "type" : 1, "uri" : "/res/symbols/two_hearts.png", "keyword" : ["heart", "pink heart"], "group" : "heart", "thumbnail" : "", "description" : "Two pink love hearts." } ] }
- Define metadata.
Add a sticker metadata in the tizen-manifest.xml file to set the JSON local path.
<metadata key="http://tizen.org/metadata/sticker" value="/res/default_sticker.json"/>