Package 

Class AttachmentsDatabase


  • 
    public class AttachmentsDatabase
    
                        

    Class for simple interaction with database containing attachemnts.

    When the first read or write requests are made, database will be 'opened' and later should be close manually via close method. If database has been 'closed' but new read/write request is made then it will be opened again and will have to be closed again.

    Simple interactions with database are fast and can be done on main thread. However, there are exceptions. For example, if there is a massive data to write or database needs to change it's structure (onUpdate/onDowngrade/onCreate) it could block caller thread for some time. So it is recommended to call all read/write methods from worker thread.

    See great article on Android DB: https://www.grokkingandroid.com/sqlite-in-android/