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
Contributor
Posts: 42
Registered: ‎05-30-2012
My Device: Simulator
My Carrier: Developer

FilePicker doesn't open in simulator

[ Edited ]

I construct a file picker this way:

 

    m_picker = new pickers::FilePicker(this);
    m_picker->setTitle("Select picture");
    m_picker->setMode(pickers::FilePickerMode::Picker);
    m_picker->setViewMode(pickers::FilePickerViewMode::GridView);
    QObject::connect(m_picker, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onDialogSelectionCompleted(const QStringList&)));

 Later I do:

 

m_picker->open();

 And nothing happens. I am told that that it opens on a device, but I see nothing in the simulator.
 I need this solved because I need to know the path format that the dialog returns when a file is selected.

 

Edit:

I forgot to mention that nothing happens even if I try the filepicker sample app provided here: https://github.com/blackberry/Cascades-Samples/tree/master/filepicker

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: FilePicker doesn't open in simulator

seems to be a problem with filepicker

 

I'm getting compile error for simulator-debug:

 

MAKEFILE_GENERATOR/Applications/bbndk/host_10_0_9_52/darwin/x86/usr/bin/ntox86-ld: cannot find -lfilepicker

 

runs well on device-debug

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Contributor
Posts: 42
Registered: ‎05-30-2012
My Device: Simulator
My Carrier: Developer

Re: FilePicker doesn't open in simulator

-lfilepicker doesn't get recognized when  building for simulator at least. If you want to build for simulator with that library, use -lbbcascadespickers.

 

Also, kudos to the documentation for not mentioning this.

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: FilePicker doesn't open in simulator

[ Edited ]

AleksDef wrote:

-lfilepicker doesn't get recognized when  building for simulator at least. If you want to build for simulator with that library, use -lbbcascadespickers.

 

Also, kudos to the documentation for not mentioning this.


using -lbbcascadespickers instead of -lfilepicker

 

but compile error on simulator and device:

/Applications/bbndk/target_10_0_9_386/qnx6/usr/include/qt4/QtDeclarative/qdeclarative.h:128: undefined reference to `bb::cascades:Smiley Tongueickers::ViewMode::staticMetaObject'

 

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: FilePicker doesn't open in simulator

found it

 

had to rename

 

<bb/cascades/pickers/ViewMode>

to

<bb/cascades/pickers/FilePickerViewMode>

 

now it compiles and runs on simulator and device using -lbbcascadespickers instead of -lfilepicker

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Contributor
Posts: 42
Registered: ‎05-30-2012
My Device: Simulator
My Carrier: Developer

Re: FilePicker doesn't open in simulator

Does it actually open in the simulator when needed, and does it successfuly select a file on a device?

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: FilePicker doesn't open in simulator

compiles on both

 

opens files only on device

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
New Contributor
Posts: 4
Registered: ‎11-02-2012
My Device: PlayBook
My Carrier: Developer

Re: FilePicker doesn't open in simulator

Hi, I have include the needed files, but also get an error of "undefined reference to `bb::cascades:Smiley Tongueickers::FilePicker::FilePicker(QFlags<bb::cascades:Smiley Tongueickers::FileType::Type>, QFlags<bb::cascades:Smiley Tongueickers::FileType::Type>, QStringList const&, QStringList const&, QString const&, QObject*)"

 

I think the reason is that the lib is not linked.

 

Since the Makefile.Debug or Makefile.Release is generated by the NDK, how can I add the -lbbcascadespickers to the makefile?

New Contributor
Posts: 4
Registered: ‎11-02-2012
My Device: PlayBook
My Carrier: Developer

Re: FilePicker doesn't open in simulator

Sorry, when I add -lbbcascadespickers in the .pro file, compile success. But when filePicker->open() called, nothing happen, why? I run the app in the simulator.

 

Are there anybody can give me a favour?

Developer
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: FilePicker doesn't open in simulator

FilePicker compiles for simulator, but doesn't work at all. Here is error log. Probably not implemented for simulator(release 2318)

 

Jan 12 06:54:16.419    com.example.bb10samples.pickers.filepicker.testDev__filepicker2.112685171    default    9000    INFO        FilePickerPrivate::onCardInvokeRequestFinished()  . error= 6 
Jan 12 06:54:16.419    com.example.bb10samples.pickers.filepicker.testDev__filepicker2.112685171    default    9000    INFO        "Unable to open File Picker/Saver Card" 
Jan 12 06:54:16.419    com.example.bb10samples.pickers.filepicker.testDev__filepicker2.112685171    default    9000    INFO        InvokeReply::Error= "6" 
Jan 12 06:54:16.614    com.example.bb10samples.pickers.filepicker.testDev__filepicker2.112685171    default    0    INFO        NavigatorEventHandler::Received - BPS - NAVIGATOR_CHILD_CARD_CLOSED