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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
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;
    }

Developer
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
Regular Contributor
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

 

Developer
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
Regular Contributor
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

 

 

Highlighted
Developer
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