Question
I'm trying to launch the image picker in my Tizen application, but I need it to show images from a specific directory (Shared/res) or display only certain specified images. Currently, when I use the app control with the pick operation, it always defaults to the images directory.
Here's the code I'm using:
var appControl = new tizen.ApplicationControl(
'http://tizen.org/appcontrol/operation/pick',
null,
'image/*',
null,
null
);
Additionally, is there a way to view the defined application control properties for installed apps? For example:
<tizen:app-control>
<tizen:src name="edit.html"/>
<tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
<tizen:uri name="file"/>
<tizen:mime name="image/jpeg"/>
</tizen:app-control>
Answer
Problem Understanding
The user wants to:
- Launch an image picker that shows content from a specific directory (Shared/res) rather than the default images directory
- Optionally, display only specific images from that directory
- Understand how to view application control properties for installed apps
Solution Methods
-
Using AppControl with URI parameter: You can specify the directory by adding a URI parameter to the ApplicationControl:
var appControl = new tizen.ApplicationControl( 'http://tizen.org/appcontrol/operation/pick', null, 'image/*', null, [new tizen.ApplicationControlData("uri", ["file:///opt/usr/media/Shared/res"])] ); -
Viewing AppControl properties: To view application control properties for installed apps, you can use the
tizen.application.getAppMetaData()method:tizen.application.getAppMetaData( appId, function(metadata) { console.log(metadata); }, function(error) { console.log("Error: " + error.message); } );
Additional Tips
- Make sure your application has the proper privileges (
http://tizen.org/privilege/filesystem.read) - The exact path format may vary depending on your Tizen version and device
- For more information on ApplicationControl, refer to the Samsung Tizen OS documentation