How to send image to mobile client to from PC using Obex Get operation

2 views
Skip to first unread message

PugalFromPlantEarth

unread,
Aug 25, 2008, 3:51:56 AM8/25/08
to bluecove-users
Hi all

I'm able to send the simple strings with defined length to the
mobile client using Obex Get operation. But I'm unable to do it using
some binary data (ex png image).. The actual problem is I can't able
to send the length prior to the mobile client. because following line
of code returns null even I set the length in server.

HeaderSet hsr = po.getReceivedHeaders();
Long longObj = (Long) hsr.getHeader(HeaderSet.LENGTH);

Then I tried to write the length in first two bytes of the
outputstream before writing the entire bytes. but I'm unable to read
the length bytes back in the client, it reads different number.

The code I used to write the length in side the GET operation in PC
server

int len = replyData.length;
OutputStream os = op.openOutputStream();
os.write((len & 0xFF00) >>> 8);
os.write(len & 0xFF);
os.write(replyData);

The code I used to read the length in Mobile client

InputStream is = po.openInputStream();
int len = (is.read() & 0xFF) << 8;
len |= is.read();

I'm stuck to proceed further.. anybody has any idea plz let me know..
Thanks in advance..




PugalFromPlantEarth

unread,
Aug 25, 2008, 3:55:39 AM8/25/08
to bluecove-users
Hi all

I'm using BlueCove version 2.0.3 on widcomm BTDriver and Nokia E71

BP_Akito

unread,
Aug 25, 2008, 10:55:01 AM8/25/08
to bluecove-users
From PC to a device!? O from a device to PC?

On Aug 25, 2:55 am, PugalFromPlantEarth

PugalFromPlantEarth

unread,
Aug 26, 2008, 1:22:30 AM8/26/08
to bluecove-users
From PC to Device

BP_Akito

unread,
Aug 26, 2008, 2:25:35 PM8/26/08
to bluecove-users
ok, can u send me ur code?!

On Aug 26, 12:22 am, PugalFromPlantEarth
Reply all
Reply to author
Forward
0 new messages