Hey, I am working on an application which sends an image captured from the cellphone camera to a server after a fixed interval of time. Currently,I am testing a way to send an image to a PC server. I am trying to make the following code work but it gives
"java.io.IOException" at the line "out.write(rgbByteArray)" at the DataTransmitter.java
The DataTransmitter.java code is is handled by a midlet.and for image capture it uses CameraCanvas.java and for detecting devices it uses ServiceDiscoverer.java and DeviceDiscoverer.java...The bluetooth n device discovery are all working fine. Problem comes when i the "out.write()" line is executed.
The Server code is :
The DataTransmitter.java code is It is handled by a midlet.and for image capture it uses CameraCanvas.java and for detecting devices it uses ServiceDiscoverer.java and DeviceDiscoverer.java)
Welcome to the JavaRanch. You must have missed our naming policy when registering. In short, your name must be a real (or at least real-sounding) first and last name, separated by a space. You can change your displayed name here. It will help us help you if you isolate the problem in your code. Few of us have the time to read through 100's of lines of code.
Hey Joe, Sorry I will take care about that. Actually I am trying to send an image captured from a sony ericsson s60 phone camera to a PC Server via bluetooth. The problem which I am facing now is that-> the image comes out to be black on the server side.(black as in a totally black rectangle).
You have two unrelated pieces of code there. The first reads 1024 bytes (why that number?) from somewhere into a byte array. The second does something with images. Was it supposed to use that byte array in some way?
posted 11 years ago
Hey paul.. I have changed the byte code reading part on the server side to :
then it creates an image using this imageBytes array by :
The client side code remains same: where the byte array from the CameraCanas class is converted to pixel byte array by
This rgbByte pixel array is send to the server via Outpust stream using
Now the problem faced is : When i print the number of bytes read i.e 'b' it prints the bytes count till a certain value and then the code runs into a non yielding state... no printing of b or anything after that..and neither a file a.png is created. for eg the output of b is : 328 328 328 . . . . . 328 32 (. denotes a series of 3 digit numbers) After this the program gets stuck!!