I try to sending and showing image file.But I can showing and encoding/decoding image about 50kb(lower than 50kb).But when I tried send/encode image(bigger than 100kb),I get an error."java.lang.OutOfMemoryError"
Uri selectedImage = intent.getData();
String filePath=MediaOperations.getPath(getApplicationContext(), selectedImage);
if (bmp != null && !bmp.isRecycled()) {
bmp = null;
}
bmp = BitmapFactory.decodeFile(filePath);
I use this codes for getting file path.
I convert bitmap to byte array and byte array to base64string.And I'm sending basese64string to server with socketio.And I am show bitmap in ImageView.But base64 encoding doesnt work when file larger then 50kb.How can I solve this problem.?
I tried:
android:largeHeap="true"but did not solve my problem
Thanks in advance
0 comments:
Post a Comment