I am using the following code to encode my image bitmap into a byte[] and then to a string but at the time of encoding it into byte[] it says unable to encode..
Bitmap bm = BitmapFactory.decodeFile(path);
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        (bm).compress(Bitmap.CompressFormat.JPEG, 100, stream);
        bm.recycle();
        byte[] byteFormat = stream.toByteArray();
        String encodedImage = Base64.encodeToString(byteFormat, Base64.NO_WRAP);
The app is working fine, but I am stuck here. Suggest issues.
 
     
    