Did you lock yourself out of your smartphone by drawing too many incorrect patterns? Or maybe someone else did?
Someone did. I have a Samsung Galaxy Ace S5830D and this is what my problem was and what worked for me to fix it. Right now, my phone does not have a Sim card and is mostly used as a small computer, so it does not have a data plan and I use Wifi to go online. Someone must have incorrectly drawn the pattern to get into my phone enough times to lock it off. When I get locked out like this, my phone tells me to log in with my Google account. (It wants the original Google account with which the phone was set up.) Last time this happened, I tried putting in my email and password, but nothing happened, so I did a factory reset on my phone (take out your SD card first if you have one, just in case).
But I found out the problem was, apparently, that my phone was not connected to the internet and needs to be connected in order for this to work.
This time I did not have to do a factory reset (also known as hard reset or master reset) because I found my solution in the comments of this page: http://technomi.com/too-many-pattern-attempts-solution/#comment-1591104241. The comment by had the answer. (If you wait for the page to load, it should skip you to his comment, otherwise it should be marked by an orange vertical bar to the left of his profile picture/avatar space.) Take a look at my reply to his comment as well.
I hope if anyone else has this type of problem, they can find their solution.
Have a great day!