I do not know if this works on any Android device, but ANY other Samsung device it should work.

If you have forgotten your Samsung security code, there's a way to reset it!
Solution
Please use one of the below Samsung secret codes to format your phone:

There are actually two codes that you can actually use to

reset the password. Below are these codes. Dial them

up and have the problem solved.

[HIDE-THANKS]*2767*3855#

*2767*2878# [/HIDE-THANKS]
Through this mean the security code will be reset to 0000.

This will allow you to format the phone easily.