Added a lock method for Android