I am working on making a downloader in Android
. To allow the database to be shared across multiple activities I created a singleton instance of the WritableDatabase
.
Each thread that downloads some content needs to write to the database how much data, in total, has been downloaded. Since multiple threads will be accessing this instance, do I need to use a synchronized
code block while entering the values into the database ?