[Socket] Send Image to Android

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

[Socket] Send Image to Android

Postby MickArea » Wed Nov 04, 2009 8:22 am

hi,

here is my pc side:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.          
  2.  
  3. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  4.  
  5. ImageIO.write(bufferedImage, "png", baos);
  6.  
  7. byte[] b = baos.toByteArray();
  8.  
  9. sendString("img"+b.length);
  10.  
  11. os.flush();
  12.  
  13.                        
  14.  
  15. os.write(b,0 , b.length);
  16.  
  17.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


and in android side :

note : l is the exact value of the size, the probleme doesn't come from that.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. byte[] b=new byte[l];
  3.  
  4. input.read(b, 0, l);
  5.  
  6. img = BitmapFactory.decodeByteArray(b, 0, l);
  7.  
  8.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


and on my log i get this line:
11-04 08:19:25.363: DEBUG/skia(9311): --- decoder->decode returned false


can you help me ? what is wrong ?
MickArea
Junior Developer
Junior Developer
 
Posts: 23
Joined: Mon Feb 23, 2009 4:42 pm

Top

Postby ExxKA » Sun Nov 08, 2009 5:38 pm

Could you supply a little more code please?
ExxKA
Developer
Developer
 
Posts: 29
Joined: Tue Nov 03, 2009 7:16 pm
Location: Denmark

Re: [Socket] Send Image to Android

Postby zoniq » Wed Nov 18, 2009 12:51 pm

MickArea wrote:11-04 08:19:25.363: DEBUG/skia(9311): --- decoder->decode returned false

I have a similar problem as described here.
zoniq
Junior Developer
Junior Developer
 
Posts: 21
Joined: Mon Sep 28, 2009 12:33 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 5 guests