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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified
Accepted Solution

converting image file to base64encoding string

I tried conveting image to base64 encoding stirng to be sent to the server.. I am able to retrieve the file path succesfully using file picker, but converting image to string is raising concerns. I used base64outputstream n all sort of stuff.. But Sometimes they work, some times they wont... I want to have a code snippet which accomplishes my task... Can some1 help me???

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: converting image file to base64encoding string

try{
	if(capturedImageBytes!=null)
		inputRaw = net.rim.device.api.io.Base64OutputStream.encodeAsString
(capturedImageBytes, 0, capturedImageBytes.length, false, false);
}catch(Throwable th){
	System.out.println("th.getMessage() ########## image ### inputRaw -------------- " +th.getMessage());
}

   I guess, It sometimes fail due to image size too big..

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: converting image file to base64encoding string

So, Is there a certain size limit for outputstream ?

Highlighted
Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: converting image file to base64encoding string

I suggest developers who are encoding the image to resize the image programitically before encoding.. this will accomplish the Encoding task 99 out of 100 times Smiley Tongue ...