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
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: FilePicker camera activation

[ Edited ]

http://developer.blackberry.com/cascades/documentation/device_platform/invocation/menus.html

 

It's a shame you haven't taken the time to read the links I've posted to understand invocation as creating your own camera page is and never has been my recommendation.

 

This and your lack of appreciation either by failing to hit the like button or just saying thanks also makes me question why am I bothering to continue to help you.  I will leave it up to others from now.

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 44
Registered: ‎01-22-2013
My Device: Z10, Q10, Z10 Alpha
My Carrier: None

Re: FilePicker camera activation

[ Edited ]

I am sorry but this still does not explain why I have a Camera option in my FilePicker unless it is supposed to be there.

 

Even after reading your links.  And especially after reading 

 

http://developer.blackberry.com/cascades/documentation/device_platform/invocation/menus.html

 

Like I stated, I have only used teh documented usage of FilePicker.  nothing else has been added.  Nothing in my project specifies Invocation or the methods used in creating tehse things.  So this all leads me to believe that the FilePicker has teh Camera built into it or the sdk decides what its going to add without the developers input.

 

 

EDIT : I am sorry that you take offense that people do not thank you for every post you make.  I always thank people for their time and as this was an ongoing thread ( which is like an ongoing conversation ) I tend not to thank someone for every post ( like I would not thank someone after every sentance in a conversation ).

 

On top of that as of this point you have not actually provided any information that has been helpfull in the OP.  You have have just posted links that have been posted countless times in these threads and ones that I have read through countless times.

 

 

 

 

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

Re: FilePicker camera activation

[ Edited ]

PJDavis1970 wrote:

... or the sdk decides what its going to add without the developers input.

 


 

Substitute 'sdk' for 'invocation platform' and you'll have it.

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 44
Registered: ‎01-22-2013
My Device: Z10, Q10, Z10 Alpha
My Carrier: None

Re: FilePicker camera activation

[ Edited ]

Sorry where do I find what you are refering to here?

 

EDIT - The only thing I can think that you are refering to is the actual SDK I am building against.

 

I am currently building against BlackBerry 10 Native SDK 10.0.10.672

 

EDIT EDIT -  OK I see where you are coming from.  I get it now you are saying it does it automatically anyway..hence "Invocation"..  But from reading teh documentation.... I thought you had to actually state things...

 

Quoting part of the docs..

 

Add bound invocations

The ActionItem class represents the actions that your app supports, but your application can also add actions that other apps support to the application section of your app's context menu. However, applications can also add the actions supported by other apps, to the application section of their context menu by using the invocation framework. When an invocation request is sent, an action is created as InvokeActionItem, which extends the ActionItem class. Here's how you can add a bound invocation action to the context menu using QML and C++:

InvokeActionItem {
    query {
        invokeTargetId: "com.example.image.view"
            mimeType: "image/png"
        invokeActionId: "bb.action.OPEN"
        uri: "file:///.../image.png"
    }
}
InvokeActionItem invokeItem;
invokeItem.setTarget("com.example.image.view");
invokeItem.setAction("bb.action.OPEN");
invokeItem.setMimeType("image/png");
invokeItem.setUri("file:///.../image.png");

 

Highlighted
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: FilePicker camera activation

[ Edited ]

Okay perhaps I've been a little harsh perhaps you have not read the forum guidelines and realised that the little button with a thumbs up is the way to thank people for continuing to show interest in your problem.  We are volunteers here taking time away from our own development to help and so clicking on the button as you read a post occasionally isn't a lot to ask in exchange for our time.

 

In fact looking at your profile I'm surprised to find I'm the only one to ever like one of your posts and the reason I did it was not because I had any intention of using the code, or that it any any way has helped me, instead it was the fact that many people don't bother to post a solution after being helped and I thought this was worth showing some appreciation of.

 

However I can't understand your posts about invocation as if you had read my links you would clearly see that placing menu options in to apps not of your own writing is exactly what invocation does.

 

Not being able to see you code and not having hardware is restricting me make a definitive diagnosis on whether the 'camera action' comes from your code or is inherent in the FilePicker code but whichever one it is one thing I am certain of is that the camera code is not in the FilePicker class, and I'm 99% sure it will be using invocation to display the camera app.

 

[Edit] Seen your re-edit, thank God we finally got there. Smiley Happy

 

 

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 44
Registered: ‎01-22-2013
My Device: Z10, Q10, Z10 Alpha
My Carrier: None

Re: FilePicker camera activation

[ Edited ]

Thank you for your response and after having a cig ( didnt like my other abriviation of the word lol ) and spending 10 minutes away from my screens I have been able to re-read through the posts and documentation and have now cottoned onto what you have been saying.

 

Thanks again and sorry about missing the thunbs up bit.

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

Re: FilePicker camera activation

[ Edited ]

That's okay, as long as we got there in the end.

 

Hopefully you will see now that with just a few lines of QML you can invoke the camera yourself, how you tie that in to your UI can be as simple or complex as you like/require.

 

Hence the lines about maybe having to subclass FilePicker or write your own CustomControl if you insisted on doing it through this control.

 

[edit] I wondered what the bleeped word was. Smiley Happy

 

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Contributor
Posts: 44
Registered: ‎01-22-2013
My Device: Z10, Q10, Z10 Alpha
My Carrier: None

Re: FilePicker camera activation

Well it took me a while to get my head around Invocation but now imloving it Smiley Happy  Thanks to BBSJdev I now have a nice flued camera working.  here is how I did it.

 

Ignore the paramater retID this is a string containing a return address in my javascript where to send the image base64 encoded string data.

 

void BBOmnisWrapper::InvokeCamera( QString retID )
{
	this->mCameraReturnID = retID;
	InvokeManager *invokeManager = new InvokeManager(this);
	InvokeRequest request;
	request.setTarget("sys.camera.card");
	request.setAction("bb.action.CAPTURE");
	request.setMimeType("image/jpg");
	request.setData("photo");
	connect(invokeManager, SIGNAL(childCardDone(const bb::system::CardDoneMessage&)), this, SLOT(childCardDone(const bb::system::CardDoneMessage&)));
	InvokeTargetReply *reply = invokeManager->invoke(request);
}

 

message.data contains teh filename and path to my newely taken image.

 

void BBOmnisWrapper::childCardDone(const bb::system::CardDoneMessage &message)
{
    if (!message.data().isEmpty())
    {
    	QVariant returnedValue;
        QMetaObject::invokeMethod(mWebViewObject, "respondWithCameraImage", Qt::DirectConnection,
                Q_RETURN_ARG(QVariant, returnedValue), Q_ARG(QVariant, message.data() ), Q_ARG(QVariant, this->mCameraReturnID ) );
    }
}

 

 

Developer
Posts: 169
Registered: ‎03-25-2011
My Device: Playbook, Z10 L.E.
My Carrier: Vodafone NL

Re: FilePicker camera activation

Thanks for posting your solution @PJDavis1970! I am also running into similar problems. You can see the full conversation here.

 

Apparently, it's not yet possible to invoke the Camera Card via QML. The BlackBerry guys told us to create a Feature Request for it and that's what I'll do once JIRA's works for me again.

 

Hopefully more people will support the FR.

Cheers.

Cheers!