show image having name in database in android

0

good, I would like to consult, since I did not use the method of saving the image in the db, I would like to show an image that I have stored in the directory of the same application, but I would need to take the name from the database, but looking for I can not find the method to do it, I am currently working with java, without frameworks

so I was asked for a little more information, Currently, I have stored in the db the image as a varbinary, which I bring as json string and thus try to make the conversion from the app with this method

byte[] decodeString = new byte[0];
        try {
            decodeString = Base64.decode(i.getImagen(), Base64.NO_OPTIONS);
        } catch (IOException e) {
            e.printStackTrace();
        }
        Bitmap decodebitmap = BitmapFactory.decodeByteArray(decodeString,
               0, decodeString.length);
        imagen.setImageBitmap(decodebitmap);

but it returns the conversion error by base64,

Now, in consultation with a friend, he told me that what can be done (theoretically more viable) is to save the image inside a directory in the filesystem by hacking it, and store the name of it in the db and then decrypt it from the app, and call it externally, to what I was looking for something similar but I have not managed to get some data for it

    
asked by Pablo Ezequiel Ferreyra 12.01.2018 в 14:12
source

0 answers