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

Web and WebWorks Development

Reply
Regular Contributor
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

How to encode Image (use playbook to take picture) to base 64 string

Hi everyone,

 

I am developing my app.

I wanna take picture (use BlackBerry playbook) and after that encode this picture to base64 string to submit server!

 

Could you help me?

See your response soon!

 

An Pham

Highlighted
Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: How to encode Image (use playbook to take picture) to base 64 string

Hey,

 

just a quick question: do you actually read the API documentation before asking questions here? It's pretty useful... Smiley Wink

 

https://developer.blackberry.com/html5/apis/blackberry.media.camera.html#.takePicture

  • will return a filePath of the taken image

https://developer.blackberry.com/html5/apis/blackberry.io.file.html#.readFile

  • allows you to read that file into a blob

https://developer.blackberry.com/html5/apis/blackberry.utils.html#.blobToString

  • converts that blob into any selected encoding (e.g. BASE64)
- - -
My approved apps @ App World
Regular Contributor
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

Re: How to encode Image (use playbook to take picture) to base 64 string

Hi biggerCC, Smiley Sad

 

I just try to folow this guide, but it is not succeded.

 

Could you give me example?

 

See your response soon!

 

An Pham

Regular Contributor
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

Re: How to encode Image (use playbook to take picture) to base 64 string

Hi biggerCC,

I have a other way. It's great!

Thanks your opinion! ^^
Developer
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: How to encode Image (use playbook to take picture) to base 64 string

Ah, da*n. 

The sample code was almost done, but I've problems getting the app running in the simulator. Once that's sorted out, I will still post the code here. In case somebody tries is facing a similar problem...

- - -
My approved apps @ App World