07-21-2011 01:06 PM
Hello Sir/Ma'am,
please tell me the absolute path to the media directory in playbook . I want to access wallpapers, downloaded images etc.. please help me . I am badly stuck.
Thnaks in Advance,
Sandesh.
Solved! Go to Solution.
07-21-2011 01:25 PM
Hi sandeshmsg,
I would reccomend using the blackberry.io.appDirs (http://www.blackberry.com/developers/docs/webworks
button below the post(s)07-21-2011 02:11 PM
Thanks but I am not able to find the media folder . can you please tell me the full path. like file:/// .....
07-21-2011 02:37 PM
Does this code not work for you? Make sure your config has both the featureIDs and the permission tags set up
<script type="text/javascript">
var dirs = blackberry.io.dir.appDirs;
alert('Application storage folder path:' + dirs.app.storage.path);
// access_shared permission must be added in order to access shared folders
var musicDir = dirs.shared.music.path;
alert('Music folder path:' + musicDir);
</script>The full strucure of the returned data will look like this, so just use the corresponding key for the type of data you're looking for.
{
"data" : {
"app": {
"storage" : {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/data"
}
},
"shared": {
"bookmarks": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/bookmarks"
},
"books": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/books"
},
"camera": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/camera"
},
"documents": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/documents"
},
"downloads": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/downloads"
},
"misc": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/misc"
},
"music": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/music"
},
"photos": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/photos"
},
"print": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/print"
},
"videos": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/videos"
},
"voice": {
"path" : "file:///accounts/1000/appdata/WebWorksAppTemplate .testa3NBcHBUZW1wbGF0ZSAgICA/shared/voice"
}
}
}
}
button below the post(s)07-21-2011 03:06 PM
Only first alert statement is getting executed. Not second one .
my config.xml content is...
<?xml version="1.0" encoding="UTF-8"?><widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets" version="2.0" rim:header="RIM-
Widget:rim/widget">
<name>Hello World</name>
<description>Sample app.</description>
<author rim:copyright="2011">Sandesh</author>
<icon rim:hover="false" src="icon.png"/>
<icon rim:hover="true" src="icon.png"/>
<content src="index.htm"/>
<feature id="blackberry.io.dir" />
<rim
ermit>access_shared</rim
ermit>
</widget>
07-21-2011 03:10 PM
Hi sandehmsg,
I guess this needs to be more clear, but the permits tag have to be inside of a permissions element. If it works you'll get a pop-up when you start the app.
<rim:permissions> <rim:permit>access_shared</rim:permit> </rim:permissions>
button below the post(s)07-21-2011 03:14 PM
How can i miss that
.....
Thanks a lot its working now .