One of the answers in the links you showed, suggests to use Base64 embedded image:
(https://stackoverflow.com/a/9000691/1271435)
<img src="data:image/jpg;base64,xxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
xxxxx = base64 encoded string of images bytes
This sounds like a good idea, and one way to do it is something like this:
After taking the image with camera you should get back an imageUri
of the photo.
then:
1.Get the input stream of that image:
InputStream stream = getContentResolver().openInputStream(imageUri);
2.Fill in the stream into a ByteArrayOutputStream
:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
fillStream(stream, baos); // dummy method, provide implementation
3.Convert the byte array to Base64:
String base64Image = new String(Base64.encode(baos.toByteArray(), Base64.DEFAULT));
Then you can use the base64 string as the data for your image in HTML.