I have a service that saves information to database every 10 secs.
It stops saying this error
android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 2062)
#################################################################
Error Code : 2062 (SQLITE_CANTOPEN_EMFILE)
Caused By : Application has opened too many files. Maximum of available file descriptors in one process is 1024 in default.
(unable to open database file (code 2062))
What causes this and how to prevent this like try and catch statement if it encounters such error, it will just do nothing and will wait the next loop schedule. ty
presumably you keep opening the same file over and over until your fd's are exhausted. just off the top of my head, how many times are you initializing sqlite (and where?)? or have you opened the same file over and over, and when it's sqlite's turn there are no more fd's?
i move it in the starter service, when i restarted the device, sometime it work, sometime it says , it is not initialized.
It seems that the schedule service starts first before the starter service.
How can i make sure, starter service starts first. Thanks again