How to store image retrieved from url in a SQLite database?

前端 未结 3 1620
借酒劲吻你
借酒劲吻你 2020-11-29 10:38

I am retrieving images from a url. Instead of caching the images, would it by any chance be possible to store it in a SQLite database?

                /**          


        
3条回答
  •  既然无缘
    2020-11-29 11:35

    Here's a link to how you store data in external storage: External storage

    The link explains where to place files (if you want to use external storage), and how to check if external storage is available.

    Edit: How you access files, is explained under the topic "Accessing files on external storage".

    You should in API 8, or above invoke getExternalFilesDir() to get a File that represents your applications root directory. You can then read and write the files as you normally do (using e.g. FileWriter and FileReader for text data)

提交回复
热议问题