Wednesday, May 18, 2016

Making Captcha In Android Using Android Studio Part II

Okieee... Let's continue part II... In the previous part, we have made two classess, MainCatpchaHysoka & TextCaptchaHyosoka, and now we will gonna make one more class namely MathOperationCaptchaHyosoka eheheh... :D
then extends this class from MainCatpchaHyosoka too....
Let's create variabel and it's contructor :
And change protected Bitmap image() as shown below :
Yeeeeiiiks... Coool.... Let's go to MainActivity.....First thing first.... Let's add some needed variabels for connecting our layout element to mainActivity :
Theen... Initializing our first captcha as plus_minus_multiply :
If we run this project, It should be looked like this :
Okieee... Next.. Let's put a handler for "Refresh" and "Cek" Button....Buut... first let's create a new string variabel called "answer" :

Refresh Button :
Cek Button :

Demo :

You download this project from my github repo righthere....

Making Captcha In Android Using Android Studio Part I

Let's start to make a new project..... :D





 Okieee... Next... We will gonna change main layout as shown below :
XML file :


Next, we will be using captca class from this repo. So thanks so much for the owner of that github repo, we will just gonna use his code here... :)
Sooo...create a new class :
Then change the class to abstract class like this :
Next... Put this code to MainCaptchaHyosoka :
Next.... Add a new class.... name it as you like and extend this class from MainCaptchaHyosoka {this class is for handling text captcha}:
Next.. let's create some variables and constructor for this class as shown below :
Then... put below code to the @override method like this


You can see all of above code from my github here...

Siiipss.... I think it's enough for now... I will continue this post later in part II... :)