Tizen Ver2.2 - Web Application...Tizen Ver2.2 - Web Application Tizen Content API – Content...
Transcript of Tizen Ver2.2 - Web Application...Tizen Ver2.2 - Web Application Tizen Content API – Content...
Tizen Ver2.2 - Web Application
Tizen Content API –Content Manager Application Example
Ajou Univrsity
Contents
• Content Manager Application Example
Ajou Univrsity
Content Manager Example Application
Ajou Univrsity
ContentManager Example
• A simple three – page application• Lists media directories• Lists contents of a selected directory• Overview/preview page for a single piece of content
Ajou Univrsity
ContentManager Example
• Privileges• To use ContentManager interface, the application needs read and
write access• Access can be granted by adding URIs to the Privileges section
of the config.xml
Using Add button, add
http://tizen.org/privilege/content.read
and
http://tizen.org/privilege/content.write
Ajou Univrsity
ContentManager Example
• The first page lists media directories found in the device• In index.html, the first page is defined
• The page contains a listview item that will display a list of directories
Ajou Univrsity
ContentManager Example
• This JavaScripts utilizes getDirectories method to add items to the listview
• getDirectories method returns an array of directories
• The callback function iterates through the directories array, adding each directories to the listview
The callback for
getDirectories
Ajou Univrsity
ContentManager Example
• The second page contains a list of contents in selected directory
• listview directory-contents-list will display title, URI, and size of contents
Ajou Univrsity
ContentManager Example
• JavaScript uses find method to get a list of contents in a selected directory
• For each content in the directory, a link with the title, URI, and size of the content is appended to the listview directory-contents-list
The callback for
find method
Ajou Univrsity
ContentManager Example
• The third page contains information(attributes) of a selected content
• listview content-info will display preview and attributes of the content such as title, URI, release date, etc.
Ajou Univrsity
ContentManager Example
• JavaScript appends each attribute of the content to the listview
• Then, creates an appropriate preview for the content’s data type and prepends to the listview
Creating a
preview
Ajou Univrsity
References
• Jaygarl, Hojun. "Multimedia." Professional Tizen program
ming development. Chichester: Wrox, 2014. 89-95. Print.