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
Developer
StevenKader
Posts: 635
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Trying to invoke picture viewer

Anyone get the picture viewer to invoke from C++ Cascades?  I tried this but no luck.

 

  InvokeManager invokeManager;
    InvokeRequest request;
    // Who do we want to send the invoke request to?
    request.setTarget("sys.pictures.card.previewer");
    // What do we want the target application to do with it?
    request.setAction("bb.action.VIEW");
    // What are we sending?
    request.setMimeType("image/png");
    // Where is the data?
    request.setUri("file:///accounts/1000/shared/camera/IMG_00000008.png");

 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Please use plain text.
Contributor
nmathew87
Posts: 20
Registered: ‎10-17-2012
My Device: BB10 Dev Alpha
My Carrier: Wind Mobile

Re: Trying to invoke picture viewer

here's the code I use

 

bb::system::InvokeManager* manager = new InvokeManager();;
bb::system::InvokeRequest request;


// Setup what to show and in what target.
request.setTarget("sys.pictures.card.previewer");
request.setAction("bb.action.VIEW");
request.setMimeType("image/jpg");
request.setUri(fileName);


InvokeTargetReply *targetReply = manager->invoke(request);

 

do u have all these headers ?

-----------------

#include <bb/system/InvokeManager>
#include <bb/system/InvokeAction>
#include <bb/system/InvokeReply>
#include <bb/system/InvokeRequest>
#include <bb/system/InvokeTarget>
#include <bb/system/InvokeTargetReply>

 

Also u need this in the .pro file

LIBS += -lbbsystem 

 

And i think u need to have this in the bar descriptor permissions

 

<permission>access_shared</permission>

 

this lets me invoke a single photo. But i'm not struggling with trying to invoke the whole gallery. The camera on the device does it but there's no code for it.

 

Please use plain text.
Contributor
nmathew87
Posts: 20
Registered: ‎10-17-2012
My Device: BB10 Dev Alpha
My Carrier: Wind Mobile

Re: Trying to invoke picture viewer

oops. i meant I AM struggling to invoke the picture gallery. as of now i can still only invoke a single picture. help!!

Please use plain text.
Developer
StevenKader
Posts: 635
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: Trying to invoke picture viewer

Could you please give me an example of how you specify the filename...I am still having trouible.

Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Please use plain text.
Contributor
nmathew87
Posts: 20
Registered: ‎10-17-2012
My Device: BB10 Dev Alpha
My Carrier: Wind Mobile

Re: Trying to invoke picture viewer

the format you are using seems correct

 

file:///accounts/1000/shared/camera/IMG_00000008.png

 

I had problems with that initially. but it was because I wasnt adding "file:///" to the path. 

 

I can invoke this:  "file:///accounts/1000/shared/camera/IMG_00000186.jpg". Seems exactly the same as yours.

 

Try this:   check the invoke client sample on this github page

http://blackberry.github.com/Cascades-Samples/invokeclient.html

 

enter your file path here and see if it can invoke your file. hope this helps. 

Please use plain text.
Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: Trying to invoke picture viewer

 

Are you sure that you have added the file to the camera folder via the Target File System Navigator (and not added them in assets.)..........:cathappy:

 

- Dishooom

Please use plain text.