Fixed NetworkOnMainThreadException
Fixed wakeup lock. Added static method for database object.