send image as string to webservice

8 posts / 0 new
Last post
ishanmlvy
ishanmlvy's picture
Offline
Mobile Conjurer
Joined: 7 Feb 2011
Posts:
send image as string to webservice

Hi,

I need to send an image over to the webservice,
Is there any way to do so, as webservice expects the data to be in string format.

Regards,
Ishan

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Yes, but what format is the image data in? You need to think about that. You can Base64 encode the binary data using this component- http://www.mosync.com/content/string-handling-base64

ishanmlvy
ishanmlvy's picture
Offline
Mobile Conjurer
Joined: 7 Feb 2011
Posts:

Hi,

Thanks for the reply sam.

The application that i am trying to make is a QRCode scanner, was playing around the camera api to capture images, The captured images is to be sent over to the webservice to be decoded by the zxing library.

As i was not able to find any detailed docs on the camera api ( most posts said its coming ), so i guessed i'll be having an image placeholder, which has to somehow taken as a string then encoded in base64 to be sent over.

Any pointers towrads this solution as a whole?

Regards,
Ishan

ishanmlvy
ishanmlvy's picture
Offline
Mobile Conjurer
Joined: 7 Feb 2011
Posts:

Hi,

i was successful in capturing an image and storing in in a image object.

There are two things i need to do.

1. store the image onto the device.
2. use the base64 encoding on that image ( maGetImageData returns an int array , can that be directly encoded )

How can i achieve this.

Any help is appreciated.

Regards,
Ishan

olopez32
olopez32's picture
Offline
Joined: 22 Nov 2011
Posts:

Hi, Ishan. I have the same problem using the camera API on JavaME phones. Can you post how you used successfully the camera API?

Thanks, in advance
Otto

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi Otto, off the top of my head, the Camera API isn't yet supported on J2ME devices. I'll find out for sure in the morning, and find if it is on the road map.

@Ishan - I'm really sorry I lost track of this thread! Saving the data can be done with this http://www.mosync.com/content/utilities-storehandler and B64 component is here http://www.mosync.com/content/string-handling-base64.

olopez32
olopez32's picture
Offline
Joined: 22 Nov 2011
Posts:

Thanks, Sam for the fast response. Please, do check if the Camera API is supported for the J2ME devices (including BlackBerry devices).

We have an application that requires this feature, if we can get more information about the Camera API syscalls, we are prepared to invest one senior developer to implement it for BlackBerry (OS 4, 5 and 6) and J2ME devices.

Thanks,
Otto

olopez32
olopez32's picture
Offline
Joined: 22 Nov 2011
Posts:

Thanks, Ishan. I'll read those. :)