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

Native Development

Reply
Regular Contributor
brad_qqq
Posts: 81
Registered: ‎03-27-2013
My Device: Dev Alpha C,Z10 LE
Accepted Solution

Is there invocation or API just for saving files UI?

Hi all,

 

I want to save my app json data to a txt file which user can use.So I want an invocation or other similiar API which just

realize saving  files UI function and I realize writing files function.

I have searched but can't find it. Anyone have   information?

 

Thanks.

 

brad_qqq

Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Is there invocation or API just for saving files UI?

QFile...

 

http://qt-project.org/doc/qt-5.0/qtcore/qfile.html


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Regular Contributor
brad_qqq
Posts: 81
Registered: ‎03-27-2013
My Device: Dev Alpha C,Z10 LE

Re: Is there invocation or API just for saving files UI?

[ Edited ]

QFile is for operating files.Qt have a QFileDialog to show a file dialog.

Like the function "Save as" of the "bb.action.VIEW" invocation.

Does Casacdes have a class to show saving file dialog?Or I need crate a dialog by myself?

 

 

Developer
xnike
Posts: 63
Registered: ‎11-04-2011
My Device: PlayBook, DAC, STL100-1, STL100-2

Re: Is there invocation or API just for saving files UI?

[ Edited ]
Regular Contributor
brad_qqq
Posts: 81
Registered: ‎03-27-2013
My Device: Dev Alpha C,Z10 LE

Re: Is there invocation or API just for saving files UI?

Thanks,xnike.I have used FilePicker before,but I don't know it have mode to be file saver.

Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

Re: Is there invocation or API just for saving files UI?

[ Edited ]

Use filepicker for choosing the path to save and then use QFile for save the file.

 

quote docs

FilePicker can be opened in Saver mode. In this mode, the application invoking the FilePickercan provide the file type of content and the default name and location to save the content to.

 

Set FilePickerMode to Saver

https://developer.blackberry.com/native/reference/cascades/bb__cascades__pickers__filepickermode.htm...

Saver =1

This mode allows the application to select a location for saving a file, for example, saving an email attachment or saving a modified document.

 

 

Try to read docs

https://developer.blackberry.com/native/reference/cascades/bb__cascades__pickers__filepickermode.htm...



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Regular Contributor
brad_qqq
Posts: 81
Registered: ‎03-27-2013
My Device: Dev Alpha C,Z10 LE

Re: Is there invocation or API just for saving files UI?

Yes,Benecore.That is my solution.

First use FilePicker to get file name and use QFile to write the file.

Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

Re: Is there invocation or API just for saving files UI?

Great :smileyhappy:
Please mark post (which helped) as solution :smileywink:


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog