Best way to save images which comes from server in android

后端 未结 3 867
甜味超标
甜味超标 2021-01-14 11:27

I am working on one application and getting product images from the server. Currently I am saving those images into the SQLite database after converting them into byte a

3条回答
  •  长情又很酷
    2021-01-14 12:02

    Storing app specific things on SD Card may not be the right way.. You should store images on

    // it will reside in data/data/com.package.name 
    String path = getApplicationContext().getFilesDir() + "/";
    File imagesFolder = new File(path);
    imagesFolder.mkDir();
    

    and put image files here in that folder.. So SD Card dependency can be removed.

提交回复
热议问题