I’m trying to find a way to receive a message every time the user inserts a wrong lock pattern on it’s android device.
Honestly, I don’t have a clue on how to achieve this but I’m guessing I should have some kind of service on the background registered as a listener. But on which broadcaster should I register my listener ?
I’m sorry for not having the appropriate terminology and probably my text doesn’t make to much sense… but basically I need to build a small class that executes an action every-time a wrong lock-pattern is inserted.
I’m not asking for the full code, I just need a small example, tks.
UPDATE:
It seems that what I need is impossible at the time, so, I need to find a way to receive a message every time the screen is on ? how can I achieve this ?
Apparently this is not supported by Android (if CommonsWare says it isn’t supported… then chances are you’re out of luck). Sorry!
Alternatively, you could implement your own screen lock application that can log information like this for you. Obviously this isn’t ideal, but it might be something to think about.
Edit:
The reason why you can’t do this is because the screen lock app runs in it’s own sandbox environment. A “sandbox” is a set of fine-grained controls that limits access to files, preferences, network resources, etc. For this reason, the information you require is inaccessible.