title: How to convert image into Hex String in android?
body: <p>I am need to convert image into hex string to send it to web server. I am using this method to convert image to byte array </p>
  
  <pre><code>         BitmapFactory.Options options = new BitmapFactory.Options();
           options.inSampleSize = 8; 
           Bitmap receipt = BitmapFactory.decodeFile(photo.toString(),options);
           int size = receipt.getRowBytes() * receipt.getHeight();  
           ByteArrayOutputStream stream = new ByteArrayOutputStream();
           receipt.compress(Bitmap.CompressFormat.JPEG, 90, stream);
           receiptbyte = stream.toByteArray();   
           String hexstring = toHex(receiptbyte);  
  </code></pre>
  
  <p>and this to convert into hex</p>
  
  <pre><code>   public static String toHex(byte[] bytes) {
      BigInteger bi = new BigInteger(1, bytes); 
      return String.format("%0" + (bytes.length &lt;&lt; 1) + "X", bi);
  }
  </code></pre>
  
  <p>i want to produce the output as like </p>
  
  <p><code>c11ee236-8f72-4b60-9208-79977d61993f</code></p>
  
  <p>I am not sure what to do. Do i need to encode it? </p>