0

Is there a mechanism in Android, which allows us to convert a large image into a Hex String Array before we send it to a webservice over the network?

I know how to convert it to a byte array and transfer it but I'm not so confident on how to implement the same using a Hex String.

Thanks in advance.

Ahmed Faisal
  • 4,397
  • 12
  • 45
  • 74
  • 1
    Convert to byte[] first. Then, convert to hex string like in [this thread](http://stackoverflow.com/questions/332079/in-java-how-do-i-convert-a-byte-array-to-a-string-of-hex-digits-while-keeping-l) – Tomasz Niedabylski Feb 20 '12 at 17:40
  • I had thought about that but was hoping that there would be a direct solution. Nonetheless, thank you for your comment. Since it still works, if you can post the same as an answer, I would be happy to 'accept' it for you! – Ahmed Faisal Feb 21 '12 at 23:09

1 Answers1

0

No direct method to do this. Convert to byte[] first. Then, convert to hex string like in answers to question "In Java, how do I convert a byte array to a string of hex digits while keeping leading zeros?"

Community
  • 1
  • 1
Tomasz Niedabylski
  • 5,768
  • 1
  • 18
  • 20