User Activity

hello, I want to use smart screen on off which work on proximity sensor and shaking but can't do it because I get the obligation of drawing pattern , I hope to find a solution , thanks .