how to save pdf file in SQLite

android, sqlite

Solution

You can simply read all the bytes of the pdf file and store them in the blob field of sqlite DB, but a better solution which is highly recommended is to store the files on the Internal Storage and in your DB just store the file's path. You have also to check if there is enough memory storage for you.

Problem

in my application, I have pdf files. I want to save those pdf files into my database. I am using SQLite as my Backend. How can I format those pdf file into bytes.

Original source

Related problems