[Sample App] PIN CODE Entry

Skip to first unread message


Dec 13, 2015, 5:19:26 AM12/13/15
to DroidScript
This is a PIN CODE entry code i made to have some sort of security in the app that i'm making. This technically can handle an infinite size of the PIN Code but i made it to handle between 4 to 15 only,
the reason is if its less than 4 the pin code could be useless ans easy to break. any higher than 15 and it will exceed the screen (on my 5" phone). so i made the limitation on it.

the global var collected into one object so as to be easier to control.

it can make a sound when pressed. user has option to make it silent by calling a function pincodeSound (false)

the sample OnStart() code requires user to enter a 6 digit pin and confirm the 6 digit pin and later compare both pin code.

can somebody help me. post this code on the wiki. either on "Sample Programs" section OR "Dialog - Ready to use" section. i dont know how to post it there. thanks.

my  thanks to Chris Ferrell and Steve Garman.... who help me alot in understanding how DS works. This will be my 1st code share to everybody. Hope this will be useful to a lot of people.

If you have problems in this code. post your questions here. and maybe i can help and answer your questions. but basically the code is complete.
If you want it to function differently you have to change the code. when you made you app using this code a mention of my name on the credits or about section would be nice. Thanks



Dec 13, 2015, 9:01:42 AM12/13/15
to DroidScript
If i have some other ideas for to add to this i can make a plug-in for the DS so that mask entries like pin code and passwords can be in a plugin like Password.js plugin or something.

Will post on later date if i get all of these collected for one plug-in


Dec 13, 2015, 9:02:49 AM12/13/15
to DroidScript
anybody have some suggestions ?


Dec 13, 2015, 11:14:21 AM12/13/15
to DroidScript
I just tested, ran perfectly. :)

I think someone will find this quite useful.

Thanks for sharing!

Steve Garman

Dec 13, 2015, 12:18:01 PM12/13/15
to DroidScript
I agree with Chris. It does work beautifully.

I have posted the code (without the sound file) and a link to the first post in this thread on the wiki at http://wiki.droidscript.me.uk/doku.php?id=sample_code:pincode
so that people can download the SPK from here.

Unfortunately, we cannot upload spks to the wiki.


Dec 13, 2015, 1:30:23 PM12/13/15
to DroidScript
thanks for posting it to the WIKI... hope my contribution will help someone... there are quite a few pointers in my coding which both of you helped.... i especially like the buttons which is an array. and works also (chris gave me the tip) on how to execute it without too much redundant code. =) the of course steve you gave me a lot of help also =) glad both  of you approve the coding  and find it useful.

sankarshan dudhate

Dec 16, 2015, 10:16:58 AM12/16/15
to DroidScript
Hi Netpower,
It is a good sample. Thanks for Sharing !


Reply all
Reply to author
0 new messages