tags:

views:

232

answers:

0
hi sir 
 i am new in android i am developing uploadImage in sdcard save bytearray in .net webservices 
public class ImageTest extends Activity 
 {  
 /** Called when the activity is first created. */  
@Override   
 public void onCreate(Bundle savedInstanceState)  
 { 
 super.onCreate(savedInstanceState);  
 setContentView(R.layout.main); 
 ImageView image = (ImageView)findViewById(R.id.picview); 
 EditText  value=(EditText)findViewById(R.id.EditText01); 
 FileInputStream in; 
 BufferedInputStream buf;  
 try {  
 in =new FileInputStream("/sdcard/pictures/1.jpg"); 
 buf = new BufferedInputStream(in,1070); 
 System.out.println("1.................."+buf); 
 byte[] bMapArray= new byte[buf.available()]; 
 buf.read(bMapArray); 
 System.out.println("2................."+buf.read(bMapArray)); 
 Bitmap bMap =BitmapFactory.decodeByteArray(bMapArray,0, bMapArray.length);  
 for (int i = 0;i < bMapArray.length; i++)  
 { 
 System.out.print(bMapArray[i]);  
 } 
 System.out.println("3......................"+bMap); 
 System.out.println("4........bitmaparray"+bMap.extractAlpha()); 
 System.out.println("5......................"+bMapArray); 
 System.out.println("6......................"+bMapArray.length); 
 image.setImageBitmap(bMap); 
 value.setText(bMapArray.length);  
 if(in != null)  
 {  
 in.close();  
 }  
 if (buf!= null) 
 { buf.close(); } 
 } 
catch(Exception e)  
{ Log.e("Error reading file", e.toString()); } } }  

this is the solution

11:46:16.543: INFO/System.out(736): 
 2.................-1  
 3......................android.graphics.Bitmap@435a2d98 
 4........bitmaparrayandroid.graphics.Bitmap@435a3310 
 5......................[B@435a2758 
 6......................1035 
.net webservices stroed in only byte array not in bitmap how can solve this problem please its urgent