11-20-2012 01:24 PM
Hi,
I'm working on a PlayBook app (PlayBook OS not BB10) and I'm facing an issue when I launch it on Ripple.
My confix.xml file :
<?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.0.0">
<name>Next Songs</name>
<author>LaurentCie</author>
<rim
rientation mode="landscape" />
<rim:loadingScreen backgroundColor="#000000" />
<rim
ermissions>
<rim
ermit>access_shared</rim
ermit>
</rim
ermissions>
<icon src="iconApp/nextSongsIcon.png"/>
<content src="index.html"/>
<feature id="blackberry.app"/>
<feature id="blackberry.io.dir" />
<feature id="blackberry.utils" />
<feature id="blackberry.io.file" />
</widget>
In my javascript I'm trying to retieve the object appDirs with :
vardirs = blackberry.io.dir.appDirs;
But it's not working, I got the error : Uncaught execption blackberry is not defined.
I searched on google and the forum and the only solution I've found is addind <feature id="blackberry.io.dir" /> in the config.xml file and it should work. But it is NOT !
Why ? Could you help ?
Before trying to use blackberry.io.dir.appDirs, my app was working fine in the simulator. I successfuly packaged it and it works fine on my tablet but after adding vardirs = blackberry.io.dir.appDirs; it's not anymore.
I'm not sure what I'm doing wrong...
Thanks for your help,
Laurent
11-21-2012 12:43 PM
Please help !!!!!!!
I tried to reinstall the ripple extensions but I got the same error.
Maybe it's a trouble with Sencha Touch 2.1
I tried an other project build with Sencha Touch 1.1 and I don't have such errors whereas I have blackberry.media.camera.takePicture(successCB
How should I refer to blackberry.io.dir.appDirs with Sencha Touch 2.1 ???
11-22-2012 03:30 AM
I've found a similar issue while accessing PlayBook directories on the forum :
http://supportforums.blackberry.com/t5/Web-and-Web
It looks like I forgot the "access subdomains" part in my config.xml.
I also didn't mention required="true" in my feature elements : <feature id="blackberry.io.dir" required="true"/>
I'll test with the config.xml below and let you know if it works :
<?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.0.0">
<name>Next Songs</name>
<author>LaurentCie</author>
<rim
rientation mode="landscape" />
<rim:loadingScreen backgroundColor="#000000" />
<icon src="iconApp/nextSongsIcon.png"/>
<content src="index.html"/>
<rim
ermissions>
<rim
ermit>access_shared</rim
ermit>
</rim
ermissions>
<!-- Allow local *.html pages to access these APIs -->
<feature id="blackberry.io.file" required="true"/>
<feature id="blackberry.io.dir" required="true"/>
<access subdomains="true" uri="file:///accounts/">
<feature id="blackberry.app.event" required="true"/>
<feature id="blackberry.app" required="true"/>
<feature id="blackberry.system.event" required="true"/>
<feature id="blackberry.invoke"/>
<feature id="blackberry.io.file" required="true"/>
<feature id="blackberry.io.dir" required="true"/>
<feature id="blackberry.ui.dialog"/>
</access>
</widget>
11-22-2012 12:11 PM
Hi there,
Just to confirm, are you waiting for the webworksready event to be triggered before you access the blackberry object?
11-22-2012 01:10 PM
It's not a BB10 app. I'm working on a PlayBook OS 2 application.
I need to access the file system, especially the music folder.
I just need :
blackberry.io.dir.appDirs
blackberry.io.dir.listDirectories
blackberry.io.dir.listFiles
I got the same error with the config.xml below ![]()
Uncaught ReferenceError: blackberry is not defined
11-22-2012 01:33 PM
Apologies, you even said not BB10 in your initial post but somehow my brain read it as just BB10.
Have you by chance connected Web Inspector to see if any other errors are actually occurring? Perhaps the webworks.js file isn't fully loading? Even without the webworkready requirement, I would still recommend at least waiting until DOMContentLoaded is triggered to ensure the DOM and its scripts are all ready.
I'll put together a sample application to see if I can get it running. To be clear, the goal here is to enable file access to the shared music folder, correct?
11-22-2012 01:39 PM
11-22-2012 01:48 PM
Web Inspector can be accessed:
Web Inspector documentation for reference:
https://developer.blackberry.com/html5/documentati
In your case, I would stick with Ripple for now as the FILE APIs are supported there. Bring up Web Inspector, and verify:
11-22-2012 02:28 PM - edited 11-22-2012 02:31 PM
Console :
11-22-2012 02:50 PM
When I try :
try {
dirs = blackberry.io.dir.appDirs;
}
catch(e) {
alert('error');
}
instead of
dirs = blackberry.io.dir.appDirs;
I got the error alert but I can see more things in the networks panel. But no webworks.js !