How can I insert image in a sqlite database

后端 未结 2 749
无人及你
无人及你 2020-12-04 04:00

I want to put an image from camera to database using this database code. What should be the code for the save button and the preview button?

public class dat         


        
2条回答
  •  青春惊慌失措
    2020-12-04 04:41

    Generally we don't store an image in the sqlite database as it takes a lot of time and is not encouraged but instead we store the image in the private internal storage of our app and we store the name of the image in our sqlite database and thus fetch them accordingly. Databases are not meant for storing images but only text if you try to store images it will lead to large read and write time overheads. You can store the image in internal storage as explained here https://developer.android.com/training/data-storage/files

提交回复
热议问题