android - Send Bitmap using data URI scheme -


i'm trying approach problem: share image without write_external_storage?

my idea encode png in data uri scheme. code:

bytearrayoutputstream baos = new bytearrayoutputstream(); baos.write("data:image/png;base64,".getbytes()); base64outputstream base64 = new base64outputstream(baos, base64.no_wrap); boolean ok = bitmap.compress(bitmap.compressformat.png, 0, base64); base64.close(); if (ok) {     uri uri = uri.parse(baos.tostring());     intent intent = new intent(intent.action_send);     intent.settype("image/png");     intent.putextra(intent.extra_stream, uri);     startactivity(intent); } 

the applications i've tried (e.g. gmail on android 4.4.4) cannot open image. create uri correctly? if so, prevents other applications reading image?

do create uri correctly?

i have no idea.

if so, prevents other applications reading image?

because have no idea data uri.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -