With API16 the new WAL (Write Ahead Logging) was introduced in Androids SQLiteDatabase class. I would like to test if WAL is enabled for a SQLite database. The app runs on older Android releases too, so I need a wrapper class for these new functions in SQLiteDatabase. The functions are:
- public boolean isWriteAheadLoggingEnabled()
- public boolean enableWriteAheadLogging()
- public void disableWriteAheadLogging ()
In the Android Developer Blog I did find an article for a wrapper class that wraps new classes. What I didn’t find is a wrapper for new methods in an already existing class. How should I do that?
The constructor for
SQLiteDatabaseis private so your’re not going to be able to extend it and add “wrappers” to the class itself. You can however just write a “helper” wrapper like so: