Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 165
Registered: ‎10-26-2010
My Device: BlackBerry® PlayBook™

Test your apps with the new SDK...

[ Edited ]

File system access appears to be crippled or broken. I haven't really dug in yet, but using the normal AIR File API (FileStream) to write files to File.applicationStorageDirectory does not appear to be working.

 

My app isn't saving its preferences or restore data on the simulator (a single XML file), though it it in desktop AIR and did in past versions of the simulator. On first run, my app copies a file from File.applicationDirectory to the shared Photos folder, and that is working as expected.

 

File system access permissions are set appropriately in blackberry-tablet.xml and first run did show the permission request dialog, which was accepted. It wouldn't write the file to Photos if they weren't correct.

 

I had to pull the app from App World last minute. Disappointing that it won't be there for opening day (I got 3 emails in the past week and a phone call yesterday about posting it for sale), but I'd rather people receive a fully working app and have a good first experience with it. Won't be publishing again until it's device-tested.

Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900

Re: Test your apps with the new SDK... filesystem issues

Hi,

 

    Both my apps are broken with this version as well.  They rely on the ability to get a directory of data files from inside the .bar file.  That functionality no longer works for me.  So I am waiting for hardware to see what it does on that.  If the behaviour is similar, I'll have to strip those functions out of the apps until it works again.  I can still save preferences and high score data in one app because the filenames are hard-coded into it.

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
Developer
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook

Re: Test your apps with the new SDK... filesystem issues

oh this could be bad.  my application uses the file system also to save/load preferences.

 

i wonder if it works on the device and is only problematic on this version of the simulator?

 

some of the reviews mentioned that RIM has pushed new versions over the AIR while they had the review units.  i recall the most recent version being 1.0.3

 

would be nice to receive confirmation about this issue, although there wouldn't be much anyone could do about it.


PlayBook Applications:
Drop Swatch
Developer
Posts: 425
Registered: ‎03-17-2011
My Device: Developer

Re: Test your apps with the new SDK... filesystem issues

Just curious... Have you modified your tablet xml config file to reflect the new tag "action" instead of ""permission"?

 

http://docs.blackberry.com/en/developers/deliverables/23959/Configuring_your_application_1524626_11....

_________________________
In the dark and need a sky map?
Discover What's up at App World.
Follow What's up on Facebook

Developer
Posts: 165
Registered: ‎10-26-2010
My Device: BlackBerry® PlayBook™

Re: Test your apps with the new SDK... filesystem issues

[ Edited ]

I hadn't changed it to action, but it still showed the dialog and apparently accepted the input because I was able to write to the shared Photos folder.

 

Just to be sure, I just changed <permission> to <action>, recompiled and installed and it only asked about the new capability I added (use_camera) and not access_shared which was apparently remembered even though the app had been uninstalled before with it's supposed data deleted.

 

There is no change in behavior -- still broken.

 

[it has never asked me to confirm access_internet with permission or action in this version of the simulator]

Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900

Re: Test your apps with the new SDK... filesystem issues

Hi,

 

That was it.  Why I need permissions to read my own files, I'll never understand.

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Test your apps with the new SDK... filesystem issues

What "was it"?  What did you change and what did it fix.  You said that you can now "read" your files, but the thread was talking about not being able to write files.  Thanks.

Developer
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook

Re: Test your apps with the new SDK... filesystem issues

 


MauriceRice wrote:

Just curious... Have you modified your tablet xml config file to reflect the new tag "action" instead of ""permission"?

 

http://docs.blackberry.com/en/developers/deliverables/23959/Configuring_your_application_1524626_11....


according to this (scroll down to "Files Accessible to an Application"), assuming i didn't misunderstand, reading and writing to the file system doesn't require permissions.  

 


PlayBook Applications:
Drop Swatch
Developer
Posts: 165
Registered: ‎10-26-2010
My Device: BlackBerry® PlayBook™

Re: Test your apps with the new SDK... filesystem issues

[ Edited ]

After some messing around, it's something else entirely in my app. I was assuming it wasn't saving its state properly (it isn't), but it is writing the file, so not a filesystem issue. The problem is that events aren't dispatched when they should be dispatched. For this reason, my state saving function is only called in one single circumstance (that can be tested in the sim)  instead of the 5 scenarios where it should.

 

I hook into the following to save state, but they never fire except Event.DEACTIVATE, and it ONLY fires when I have the browser open and switch to it from my app.

 

Event.CLOSING

Event.CLOSE

Event.DEACTIVATE

 

(just added these as it should detect minimizing the window -- at least on desktop)

NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING

NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE

 

(and I assume these would work, but they are not normal events and may not be used in the lifetime of the app's session)

 

QNXApplicationEvent.LOW_MEMORY
DeviceBatteryEvent.LEVEL_CHANGE
 
Before (in 0.9.3 & 0.9.4), I only listened for Event.CLOSING, Event.DEACTIVATE and the 2 device events, and state was saved as intended every single time. Back to the drawing board?

 

 

 

Developer
Posts: 425
Registered: ‎03-17-2011
My Device: Developer

Re: Test your apps with the new SDK... filesystem issues

Just to clarify, the comment for the  "shared" folder (and its subfolders) is "This folder contains subfolders that contain shared data by type. An application cannot write to this directory"

 

The words "unless the application has permission" are assumed, I would think.

_________________________
In the dark and need a sky map?
Discover What's up at App World.
Follow What's up on Facebook