Play everyone.
So now it's time to create a class called database hndler.
So let's open the Android view here.
Let's open this app folder Dhaval.
And he had opened this package.
Just click on model.
He opened this model here just click on model but I click on it and the new and then click on class
the name of the class is going to be database database handler.
Right.
So the client is class don't change anything and just click on it.
OK.
So now that our database handler class is created let's double click on this tab here in order to make
this area wider so this class database handler must inherit from that is still left open handed open
helper class.
So let's just open extents it's a light open helper is you light open.
So now that we are actually inheriting from this class is kulak of an helper.
We need to put our own logic here.
So let's create some variables inside this class.
The first value is going to be private static final strange and the name of this variable is going to
be it is going to be capitalized.
So just like in his database database underly name assignment operator.
So just put two quotes here and the name of the database is going to be martial arts.
So let's make it lubricates the martial arts database.
Right.
So let me make this the actually the capitalized martial arts database.
So this is the name of our database.
Right.
Let's create another variable.
So this variable is going to specify the version of the database so private static final int the name
of this variable is going to be database versions which are safe in here.
Database under light version assignment operator.
So you are going to assign the value number one to this valuable because this is the first actually
the version of our database.
So it makes sense to assign number one to this variable.
So now it's time to create another Raddy event.
Actually these are not ready at Bellis these are constants.
Right.
So remember a constant is actually a variable that its value cannot be changed later in the code.
So let's create another constant private's.
So let me actually change it to private static final Stream.
And the name of this variable is going to be capitalized and it is going to be martial arts martial
arts underline table right assignment operator and I'm going to put two coats here so I'm going to ask
about your martial arts.
So let's make it actually the first leader of the martial arts should be should be capitalized martial
arts.
So this is the name of our table.
OK it's better to name it in this way martial arts.
So the name of this constant is actually capitalized.
Right.
Martial arts.
So let's create another constant.
So I'm going to type in private stage static final strange and the name of this constant is going to
be actually the underline key assignment operator just put two chords here assign the value ID to this
value.
Let's create another variable private static final strange the name of this valid constant here is going
to be actually the name key so name underlined key assignment operator.
Just put two codes here.
So assigning the value name to this constant semicolon private static final strange price key price
underline key assignment operator just put two codes here and just type in here.
Price semicolon private static final screen and for it is going to be actually the color key so color
underline key assignment operator.
Put two coats here and just type in here.
Color semicolon.
So these are the constants that you actually created here inside our database handler class.
First we specified the database name.
And then we are specifying the database version martial arts table.
So this is the table that we want to put our data in.
So this this is very important.
This constant is very important and we have the ID key name key price key and the color key we are going
to use them inside our class database handler.
Here the first thing that we need to do here is going to is actually to create a constructor for this
database handler class so I can say public database handler database handler and just put a pair of
practices here inside the prentices we need to specify privater of type context right and open and close
this constructed by using these curly braces inside this constructor I must call the constructor of
the superclass which is this one is like open helper class.
So I'm going to say super and we need to pass some arguments to these super constructor here.
So let me actually just hold down the comment on my keyboard if I click on this school like open helper
class.
Now here let me show you the constructor of this class look at this constructor.
First we need to pass the context and then we passed the name to the cursor factory and aversion.
Right.
So let's pass then let's go to the datums handler class.
First we need to pass the context right.
So we created a parameter of type context here for this constructor.
So I can pass this argument here context comma.
And as the second argument we must pass the database name.
Let me show you the as you like open Hilbert helper class you can see that the second argument is of
type string and it's and it is actually name.
So this refers to the database name.
Let's go to the death of his handler class so we created a constant for that database name here right.
Right.
So I can say a database name database name comma.
So let's go to the if you like open helper class in order to see the first argument which is going to
be our third cursor factory.
So inside our application we do not actually use this cursor factor here.
So let's go to the database handler class and let's pass the value non comma.
Let's go back to school like open helper class.
And finally we need to pass the school date version.
So let's go to the date I was handed a class and we actually created a constant for this one here right
database version.
So I can just pass that your database version.
That's it.
So this is our constructor for this database handler class after this constructor.
I can't say.