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
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware
My Carrier: (none)

Upload camera image (Cascades 10 Beta 3)

How do I get the data of an image taken with a camera and upload it to a server using a Restful server in the Blackberry Cascades 10 Beta 3 SDK.  (I'm using the simulator).

 

I see there is a bb::cascades::multimedia::Camera class - and that it has a captured() signal, but that signal does not contain a paramater containg the data of the image that was captured.  So first of all, how would I get that image data?

 

And second of all, how would I upload it to a server?  Would I use a Restful service? - and if so how would I do that?, or would I just use a regular QNetworkAccessManager and use a put request to do it somehow?

Developer
Posts: 586
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: Upload camera image (Cascades 10 Beta 3)

There really needs to be an easier way for developers to be able to point to a captured image, save it to the "photo gallery" or a shared application space, or send the image off to their web service/server. Maybe a card or something. Why does each developer need to spend the time to try to figure out how to do this? 

 

Having to write this code is a total pain especially if you do not understand or able to understand from the docs or other posted information about how the process works. Although the samples are helpful, BlackBerry 10 is a totally new platform and some things still take time to figure out how to implement. Refining and making the experience work in our individual apps is a totally different story. That takes even more work.

 

BUMP

BlackBerry Development Advisor
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Upload camera image (Cascades 10 Beta 3)

If you are not interested in coding 10-20 lines of QML to use the Cascades Camera API, you can indeed launch the BB10 Camera Card to take a picture that will be saved to the camera roll.

 

 

 

 

 

BlackBerry Development Advisor
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Upload camera image (Cascades 10 Beta 3)


JohnQtQml wrote:

I see there is a bb::cascades::multimedia::Camera class - and that it has a captured() signal, but that signal does not contain a paramater containg the data of the image that was captured.  So first of all, how would I get that image data?


The Cascades Camera API is a simplified interface to the camera.  It is only capable of saving photo output, and not passing the buffer directly to you.  The photoSaved() signal is the one you'll be interested in handling, as it will tell you the filename and size of the data saved.  You can always delete the file once you have uploaded it to wherever it is you are sending it.

 

If you want access to the photo data without saving it to disk, then you will need to become familiar with the lower-level C Camera API for which there are many samples now.

http://blackberry.github.com/Community/Camera.html

 

As for your uploading and networking questions.. I'm not familiar with Restful, so not sure what to suggest.  Since the photo is a file on the filesystem at this point, you should be able to use anything ranging from libcurl to ftp to http put, etc.

 

Cheers,

Sean

Developer
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha
My Carrier: NA

Re: Upload camera image (Cascades 10 Beta 3)

For the uploading image part, please take a look at this link, it should help you: https://developer.blackberry.com/cascades/reference/qhttpmultipart.html

Dong
Developer
Posts: 1,650
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Upload camera image (Cascades 10 Beta 3)


contryboy wrote:
For the uploading image part, please take a look at this link, it should help you: https://developer.blackberry.com/cascades/reference/qhttpmultipart.html

Dong

and I can confirm that this class now (with Qt 4.8.4 bundled with cascades since Beta4) works well

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

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Contributor
Posts: 13
Registered: ‎01-02-2013
My Device: BB10
My Carrier: BB10

eRe: Upload camera image (Cascades 10 Beta 3)

can someone for you help me please !!

I d'ont understand exectly how i can make a picture taked in the server using QML or C++ !! 

I looked in the API existing in the "APIs to use the Camera on BlackBerry 10" but i all the fotos taked are in the file system of my alpha device !!

Can i find a APIs more explilined to resolve this problem, i'd like exactly take a foto of a product and put it in the server, et each product have his aown foto !!

please I need you !!!!

Regular Contributor
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware
My Carrier: (none)

Re: eRe: Upload camera image (Cascades 10 Beta 3)

Do you know how to do a regular http request in C++, QML, and QT?  If you do, then here is a way you can do multi part request, that also include an image file.  You got to put this content in the QByteArray

 

http://chxo.com/be2/20050724_93bf.html

Contributor
Posts: 13
Registered: ‎01-02-2013
My Device: BB10
My Carrier: BB10

Re: eRe: Upload camera image (Cascades 10 Beta 3)

thks,i'm still a starter devloper BB10 and i found a problems to comunicate QML and C++ but i will tray to do that.

Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: eRe: Upload camera image (Cascades 10 Beta 3)

Hey

Uploading image to server using QHttpMuliPart is not working.
Is there any other way to upload an image to server???