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
Q-T
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none
Accepted Solution

FfilePicker does not work in simulator

I am using the BB10_1_X.1483 simulator.  I have save a file that was an email attachment to my downloads subdirectory.  WHen I run my application with calls FilePicket.  I can navigate to the file and select it but up on return from the signal it says that the file by that name does not exists. 

 

Is this a known bug, am I doing something wrong.

 

I print out the file name it cannot find and it is there when I look at it whith the Momentics FileVIew tool.

 

void ImportStudentsSheet::filePickerSelectedSlot(const QStringList &fileSelection)
{
    bool bstatus;

    qDebug() << "Selected File " << fileSelection;
    QStringListIterator strIter(fileSelection);
    QString fileName = strIter.next();
    QFileInfo fi(fileName);
    if (!fi.exists()) {
        qWarning() << "file does not exists: " << fileName;  // <-- I get this even though file does exists
        filePicker->deleteLater();
        filePicker  = 0;
        return;
    }

Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: FfilePicker does not work in simulator

Does your app have Shared Files (access_shared) permission?
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.
Regular Contributor
Q-T
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: FfilePicker does not work in simulator

Oh My.  I guess not.  I never set it.    Could you be kind enough to tell me how I set it with Access Permision.

 

Thanks

 

Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: FfilePicker does not work in simulator

[ Edited ]

Double click on your bar-descriptor.xml descriptor in project tree and find a list of permissions there, put check on Shared Files. See more info here: https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.ide.userguide/topic/capabilit...

-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.
Regular Contributor
Q-T
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: FfilePicker does not work in simulator

Ok found it.  If you ask me this attribute is not very obviois and hard to find.  The documents should elaborate a little more on this and tell you where to set it. 

 

Thanks for the solution.  Will mark this closed

 

 

Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: FfilePicker does not work in simulator

Well, I was in the same situation and spent half a day trying to figure out why my file doesn't exist while the path to it is OK.
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.