java - Saving multiple images to local storage from Firebase database -




i have app connected firebase database , displays images saved previously. retrieved database fine , showed on application's screen without issues. furthermore, want save them while application running. want them saved locally independent main activity life cycle reloaded local storage when whole app destroyed , started again.

 imagedownloadlist = new arraylist<>();     lv = (listview) findviewbyid(r.id.listview);      progressdialog = new progressdialog(this);     progressdialog.setmessage("images downloading loading please wait");     progressdialog.show();      mdatbaseref = firebasedatabase.getinstance().getreference(constants.fb_database_path);      mdatbaseref.addvalueeventlistener(new valueeventlistener() {         @override         public void ondatachange(datasnapshot datasnapshot) {             progressdialog.dismiss();              for(datasnapshot snapshot: datasnapshot.getchildren())             {                 imagedownload img = snapshot.getvalue(imagedownload.class);                 imagedownloadlist.add(img);             }              adapter = new imagelistadapter(imageviewactivity.this, r.layout.image_item, imagedownloadlist);             lv.setadapter(adapter);         } 

so have getting images. how can saved array of images. imagedownloadlist arraylist.

one of simple method convert image base64 string , save using sharedpreferences or sqlite. when open app again can base64 string, convert image , show it.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -