So as you can see here these are the lines of code that I actually pasted here.
So here I created a comment and it says deleting a single computer object.
So here I want to actually create an effort in order to delete a single computer object inside the school
database.
So as you can see here the access modifier of the Smurfit is probably the return type of this method
is void.
As you can see here and the name of this method is the computer.
OK.
And here as you can see if it actually accepts an argument of type computer or case of a pass on a computer
or a computer object into this method and it's going to actually delete data computer.
OK.
So here inside the Smurfette Let's see what's going on here in line 161 as you can see.
I created an object of type as Q Like database and the name of this object is database assignment operator.
And here I initialize this object this that gets rightabout database.
So because I want to actually delete an object inside the Kulai database I need to get the right table
database not the readable database.
I want to actually write on the database so I need to actually get the writer of a database.
This is very important and in line one hundred and sixty two as I referred to the name of this object
database that delete.
So I called this method delete.
First of all I need to pass the table table computer and for the second argument I need to specify the
word class.
So at this class specifies how I want to actually delete the specific computer object.
So I'll refer to that column ID.
So I want to delete the computer object that is related to this specific column Id that we have here.
So column ID plus and inside the double quotes is equal to a question mark.
And here is the the argument for this class as you can see here the argument is this line of code here.
New string at.
So we need to provide a string at a.
And here is the object that we have inside this on a stream that the value of.
And he had dismissed it as you can see here that is to say that this string class is going to actually
convert as an integer value into the into the string value.
So history and that value of computer.
So here I referred to the name of this object computer that gets ID so it can actually delete a specific
computer object that is related to a specific column Id.
Ok to the specific ID.
So this is really important after the deletion of this computer object you need to actually close this
database.
So database that close.
So hopefully that makes sense.
And now I'm going to paste in some lines of code here and other fit here and then I'm going to explain
to you what's going on here.
So as you can see here these are the lines of code that I actually pasted here.
And he had I created a comment and it says getting the number of computers inside the New Light database.
So here I have a Meffert and the access modify it.
This method is probably the return type of this method is int integer value and the name of this method
is get computerless count.
So this method is going to return the number of computer objects that we have inside our database.
And as you can see here it's not going to accept any arguments.
OK so let's go inside this method and see what's happening here.
First of all in line 174 I created this string object as you can see here and the name of this object
is computerless.
Count queery.
OK I want to actually get the number of objects that is inside of the table here instead of inside of
that if you liked.
So assignment operator and here is our comment here.
Select and here as you can see we have these symbols here.
Start from.
So select from table.
So if you want to actually select all the computer objects that are inside of our table computer this
is very important and in line 175 as you can see here.
I created an object of type q like database and the name of this object is database so I created this
object in in order to access the database assignment operator.
Does that get like table database.
OK so here again because I want to actually just read the data from the database I could just refer
to the Mefford get readable database and instead of just write up a database I could refer to the get
readable database and it's not necessary to actually revert to the summer if it gets rightabout database.
OK.
And here in line one hundred and seventy six as you can see I have this cursor.
Here is Curson interface assignment operator.
And here I am initializing this interface here.
As you can see so database that raw query as you can see here database you refer to the name of this
object that raw query.
So you want to query all the data all the data inside the ace computers count queries so you want to
actually get all the data from this database.
Select from table computer.
So it's going to give me all the data.
And then as you can see for the second argument which is going to be that world class I assign the value
not because I want to get all the objects the information about all the objects inside the inside the
school like database and at the end I'm just closing the cursor.
OK.
And here as you can see in line 179 here as you can see I am just returning cursor that get count.
OK.
So it's going to give me the number of objects that is inside of our database.
OK For example we have 10 computer objects inside.
Inside our database this method is going to give me a good count and if it is going to give me that
number number 10 to the color of the Smurfette.
OK.
So hopefully that makes sense.
So now let's actually go inside our main activity class here and then here I want to actually make these
buttons.
This bit here at button and this BTA into this button.
A listener to the police of the user.
So I just know who live in PTEN at that said Uncle listener.
And here as an argument I need to pass the context to the context context is main activity that this.
And here again I want to make the spot in between and delete or listen to the clips of the user BTA
and delete that said unclick listener.
Main activity that is.
So now let's actually as you can see here we have an error here and we need this class and it's trying
to implement it.
The view that Uncle Clisson an interface so he here I just need to put this implements keep your keyboard
view that unclick listener.
And then here I need to overwrite the ankle if it inside our main activity class.
So I just need to type in Uncle Dick and now as you can see I am actually writing this method here.
So for the name of this argument just type in your view and then let's switch let's create a switch
statement here streatch view.
So you referred to the name of this argument view that gets ID and then here let's actually open and
close this switch statement by using these curly braces.
And and here I just need to create two case statements.
So case are thought id that BATNA at.
So when a user clicks on these are Add button bitti and add this case statement is going to be executed.
And here at the end I need to put a break statement.
Let's create another case statement.
Here are dots ID that PTEN delete and that I need to put a call in here and then I need to put a break
statement here.
So when the user clicks and these BT and delete this case statement is going to be executed.
So now inside this activity class I want to I try to paste in some lines of code here and then I'm going
to explain to you what's going on here.
So as you can see here these are the lines of code that I actually pasted here.
So in line 21 as you can see I created this list here list and inside the angle brackets I specified
the type of objects that are going to be inside of the list.
OK.
So list computer and the name of this list is all computers.
So if you have an array that are actually that can accept objects that are of type computer and the
name of this array is all computers.
OK.
So I declare this object here inside our main activity class and inline 20 free as you can see.
I created and Aurelius object.
So at least and instead the angle brackets I specified the type of objects that this at least can actually
accept and the type of objects that is on a list can accept is strange as you can see here.
And the name of this object is computerless name an inline 25 actually are created to declare declared
an object of type.
My database handler my escalate handler.
So I just need to change the name to my.
Is Kulai handler.
I am actually declaring this object here because I want to instantiate this object and use that object
that we actually created this class here.
As you can see inside our project in order to use this class for handling database OK because we want
to actually add some data to the database for it we may want to get some data from the database.
We need to actually create an object when I'm this is too late handler class.
And in 9:27 as you can see I actually did declare an object of every adapter.
So if you use this object in order to actually add some other data into our list view OK because we
want to actually add some later on the list is going to actually get the data from the database and
we want to show that it shows shows that are in our list view.
So we need these up this object here.
OK.
Ali it after this is very important.
And now let's go inside this uncreate Smurfit here.
As you can see list I should instantiate these objects that we declared inside our class.
For example these aren't computers these computers name this database handler and this adapter.
So let's go inside these uncreate Meffert and now I'm going to pasting some lines of code here and then
I'm going to explain to you what's going on here.