1
00:00:00,240 --> 00:00:04,960
So as you can see here these are the lines of code that I actually pasted here.

2
00:00:05,160 --> 00:00:10,770
So here I created a comment and it says deleting a single computer object.

3
00:00:10,770 --> 00:00:16,950
So here I want to actually create an effort in order to delete a single computer object inside the school

4
00:00:17,040 --> 00:00:17,970
database.

5
00:00:17,970 --> 00:00:24,020
So as you can see here the access modifier of the Smurfit is probably the return type of this method

6
00:00:24,030 --> 00:00:24,700
is void.

7
00:00:24,810 --> 00:00:29,020
As you can see here and the name of this method is the computer.

8
00:00:29,210 --> 00:00:29,820
OK.

9
00:00:30,090 --> 00:00:35,940
And here as you can see if it actually accepts an argument of type computer or case of a pass on a computer

10
00:00:36,110 --> 00:00:40,230
or a computer object into this method and it's going to actually delete data computer.

11
00:00:40,350 --> 00:00:40,910
OK.

12
00:00:41,190 --> 00:00:46,560
So here inside the Smurfette Let's see what's going on here in line 161 as you can see.

13
00:00:46,680 --> 00:00:53,400
I created an object of type as Q Like database and the name of this object is database assignment operator.

14
00:00:53,640 --> 00:00:58,350
And here I initialize this object this that gets rightabout database.

15
00:00:58,410 --> 00:01:05,970
So because I want to actually delete an object inside the Kulai database I need to get the right table

16
00:01:05,970 --> 00:01:08,220
database not the readable database.

17
00:01:08,280 --> 00:01:14,040
I want to actually write on the database so I need to actually get the writer of a database.

18
00:01:14,040 --> 00:01:20,460
This is very important and in line one hundred and sixty two as I referred to the name of this object

19
00:01:20,640 --> 00:01:22,310
database that delete.

20
00:01:22,350 --> 00:01:24,320
So I called this method delete.

21
00:01:24,420 --> 00:01:30,030
First of all I need to pass the table table computer and for the second argument I need to specify the

22
00:01:30,030 --> 00:01:31,110
word class.

23
00:01:31,560 --> 00:01:37,260
So at this class specifies how I want to actually delete the specific computer object.

24
00:01:37,260 --> 00:01:39,800
So I'll refer to that column ID.

25
00:01:39,900 --> 00:01:46,320
So I want to delete the computer object that is related to this specific column Id that we have here.

26
00:01:46,530 --> 00:01:52,230
So column ID plus and inside the double quotes is equal to a question mark.

27
00:01:52,470 --> 00:01:56,930
And here is the the argument for this class as you can see here the argument is this line of code here.

28
00:01:56,970 --> 00:01:58,550
New string at.

29
00:01:58,560 --> 00:02:01,040
So we need to provide a string at a.

30
00:02:01,200 --> 00:02:05,960
And here is the object that we have inside this on a stream that the value of.

31
00:02:06,180 --> 00:02:10,350
And he had dismissed it as you can see here that is to say that this string class is going to actually

32
00:02:10,350 --> 00:02:14,420
convert as an integer value into the into the string value.

33
00:02:14,580 --> 00:02:17,120
So history and that value of computer.

34
00:02:17,160 --> 00:02:24,540
So here I referred to the name of this object computer that gets ID so it can actually delete a specific

35
00:02:24,540 --> 00:02:27,870
computer object that is related to a specific column Id.

36
00:02:27,990 --> 00:02:29,550
Ok to the specific ID.

37
00:02:29,580 --> 00:02:34,230
So this is really important after the deletion of this computer object you need to actually close this

38
00:02:34,230 --> 00:02:34,840
database.

39
00:02:34,920 --> 00:02:36,670
So database that close.

40
00:02:37,170 --> 00:02:38,640
So hopefully that makes sense.

41
00:02:38,880 --> 00:02:43,620
And now I'm going to paste in some lines of code here and other fit here and then I'm going to explain

42
00:02:43,620 --> 00:02:45,640
to you what's going on here.

43
00:02:45,660 --> 00:02:49,810
So as you can see here these are the lines of code that I actually pasted here.

44
00:02:50,100 --> 00:02:56,910
And he had I created a comment and it says getting the number of computers inside the New Light database.

45
00:02:57,150 --> 00:03:00,030
So here I have a Meffert and the access modify it.

46
00:03:00,060 --> 00:03:06,180
This method is probably the return type of this method is int integer value and the name of this method

47
00:03:06,210 --> 00:03:08,000
is get computerless count.

48
00:03:08,010 --> 00:03:13,760
So this method is going to return the number of computer objects that we have inside our database.

49
00:03:14,070 --> 00:03:16,880
And as you can see here it's not going to accept any arguments.

50
00:03:16,940 --> 00:03:20,720
OK so let's go inside this method and see what's happening here.

51
00:03:20,730 --> 00:03:27,540
First of all in line 174 I created this string object as you can see here and the name of this object

52
00:03:27,540 --> 00:03:28,590
is computerless.

53
00:03:28,920 --> 00:03:30,180
Count queery.

54
00:03:30,350 --> 00:03:36,420
OK I want to actually get the number of objects that is inside of the table here instead of inside of

55
00:03:36,460 --> 00:03:37,640
that if you liked.

56
00:03:37,890 --> 00:03:41,580
So assignment operator and here is our comment here.

57
00:03:41,610 --> 00:03:45,290
Select and here as you can see we have these symbols here.

58
00:03:45,290 --> 00:03:47,020
Start from.

59
00:03:47,060 --> 00:03:48,680
So select from table.

60
00:03:48,840 --> 00:03:54,540
So if you want to actually select all the computer objects that are inside of our table computer this

61
00:03:54,540 --> 00:03:58,600
is very important and in line 175 as you can see here.

62
00:03:58,620 --> 00:04:04,830
I created an object of type q like database and the name of this object is database so I created this

63
00:04:04,860 --> 00:04:08,590
object in in order to access the database assignment operator.

64
00:04:08,910 --> 00:04:11,630
Does that get like table database.

65
00:04:11,830 --> 00:04:19,120
OK so here again because I want to actually just read the data from the database I could just refer

66
00:04:19,160 --> 00:04:25,650
to the Mefford get readable database and instead of just write up a database I could refer to the get

67
00:04:25,780 --> 00:04:31,740
readable database and it's not necessary to actually revert to the summer if it gets rightabout database.

68
00:04:31,740 --> 00:04:32,510
OK.

69
00:04:32,940 --> 00:04:38,640
And here in line one hundred and seventy six as you can see I have this cursor.

70
00:04:38,640 --> 00:04:41,900
Here is Curson interface assignment operator.

71
00:04:42,120 --> 00:04:44,680
And here I am initializing this interface here.

72
00:04:44,700 --> 00:04:51,540
As you can see so database that raw query as you can see here database you refer to the name of this

73
00:04:51,630 --> 00:04:54,080
object that raw query.

74
00:04:54,270 --> 00:05:02,610
So you want to query all the data all the data inside the ace computers count queries so you want to

75
00:05:02,610 --> 00:05:05,930
actually get all the data from this database.

76
00:05:05,970 --> 00:05:07,490
Select from table computer.

77
00:05:07,490 --> 00:05:09,080
So it's going to give me all the data.

78
00:05:09,480 --> 00:05:14,070
And then as you can see for the second argument which is going to be that world class I assign the value

79
00:05:14,070 --> 00:05:19,140
not because I want to get all the objects the information about all the objects inside the inside the

80
00:05:19,190 --> 00:05:23,750
school like database and at the end I'm just closing the cursor.

81
00:05:23,790 --> 00:05:24,470
OK.

82
00:05:25,020 --> 00:05:33,460
And here as you can see in line 179 here as you can see I am just returning cursor that get count.

83
00:05:33,800 --> 00:05:34,150
OK.

84
00:05:34,230 --> 00:05:40,310
So it's going to give me the number of objects that is inside of our database.

85
00:05:40,320 --> 00:05:43,250
OK For example we have 10 computer objects inside.

86
00:05:43,290 --> 00:05:48,540
Inside our database this method is going to give me a good count and if it is going to give me that

87
00:05:48,540 --> 00:05:51,680
number number 10 to the color of the Smurfette.

88
00:05:51,910 --> 00:05:52,390
OK.

89
00:05:52,440 --> 00:05:54,030
So hopefully that makes sense.

90
00:05:54,030 --> 00:06:00,540
So now let's actually go inside our main activity class here and then here I want to actually make these

91
00:06:00,540 --> 00:06:01,100
buttons.

92
00:06:01,100 --> 00:06:03,990
This bit here at button and this BTA into this button.

93
00:06:04,110 --> 00:06:06,210
A listener to the police of the user.

94
00:06:06,210 --> 00:06:11,020
So I just know who live in PTEN at that said Uncle listener.

95
00:06:11,220 --> 00:06:17,450
And here as an argument I need to pass the context to the context context is main activity that this.

96
00:06:17,490 --> 00:06:22,140
And here again I want to make the spot in between and delete or listen to the clips of the user BTA

97
00:06:22,250 --> 00:06:25,950
and delete that said unclick listener.

98
00:06:26,370 --> 00:06:28,830
Main activity that is.

99
00:06:29,460 --> 00:06:35,000
So now let's actually as you can see here we have an error here and we need this class and it's trying

100
00:06:35,000 --> 00:06:36,690
to implement it.

101
00:06:36,720 --> 00:06:42,190
The view that Uncle Clisson an interface so he here I just need to put this implements keep your keyboard

102
00:06:42,390 --> 00:06:45,440
view that unclick listener.

103
00:06:45,870 --> 00:06:50,110
And then here I need to overwrite the ankle if it inside our main activity class.

104
00:06:50,130 --> 00:06:56,040
So I just need to type in Uncle Dick and now as you can see I am actually writing this method here.

105
00:06:56,040 --> 00:07:02,220
So for the name of this argument just type in your view and then let's switch let's create a switch

106
00:07:02,220 --> 00:07:04,740
statement here streatch view.

107
00:07:04,790 --> 00:07:11,610
So you referred to the name of this argument view that gets ID and then here let's actually open and

108
00:07:11,610 --> 00:07:14,420
close this switch statement by using these curly braces.

109
00:07:14,630 --> 00:07:17,330
And and here I just need to create two case statements.

110
00:07:17,400 --> 00:07:20,670
So case are thought id that BATNA at.

111
00:07:20,730 --> 00:07:26,980
So when a user clicks on these are Add button bitti and add this case statement is going to be executed.

112
00:07:27,240 --> 00:07:30,130
And here at the end I need to put a break statement.

113
00:07:30,180 --> 00:07:31,730
Let's create another case statement.

114
00:07:31,730 --> 00:07:39,810
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

115
00:07:39,810 --> 00:07:40,930
statement here.

116
00:07:41,160 --> 00:07:46,640
So when the user clicks and these BT and delete this case statement is going to be executed.

117
00:07:46,680 --> 00:07:52,710
So now inside this activity class I want to I try to paste in some lines of code here and then I'm going

118
00:07:52,710 --> 00:07:55,270
to explain to you what's going on here.

119
00:07:55,680 --> 00:08:00,460
So as you can see here these are the lines of code that I actually pasted here.

120
00:08:00,510 --> 00:08:08,150
So in line 21 as you can see I created this list here list and inside the angle brackets I specified

121
00:08:08,150 --> 00:08:11,870
the type of objects that are going to be inside of the list.

122
00:08:11,940 --> 00:08:12,280
OK.

123
00:08:12,300 --> 00:08:16,470
So list computer and the name of this list is all computers.

124
00:08:16,470 --> 00:08:23,820
So if you have an array that are actually that can accept objects that are of type computer and the

125
00:08:23,820 --> 00:08:26,360
name of this array is all computers.

126
00:08:26,370 --> 00:08:27,480
OK.

127
00:08:27,520 --> 00:08:32,880
So I declare this object here inside our main activity class and inline 20 free as you can see.

128
00:08:32,940 --> 00:08:35,640
I created and Aurelius object.

129
00:08:35,670 --> 00:08:41,840
So at least and instead the angle brackets I specified the type of objects that this at least can actually

130
00:08:41,850 --> 00:08:47,390
accept and the type of objects that is on a list can accept is strange as you can see here.

131
00:08:47,820 --> 00:08:54,750
And the name of this object is computerless name an inline 25 actually are created to declare declared

132
00:08:55,020 --> 00:08:56,040
an object of type.

133
00:08:56,040 --> 00:08:59,480
My database handler my escalate handler.

134
00:08:59,640 --> 00:09:02,000
So I just need to change the name to my.

135
00:09:02,150 --> 00:09:03,450
Is Kulai handler.

136
00:09:03,610 --> 00:09:09,120
I am actually declaring this object here because I want to instantiate this object and use that object

137
00:09:09,120 --> 00:09:11,820
that we actually created this class here.

138
00:09:11,850 --> 00:09:17,970
As you can see inside our project in order to use this class for handling database OK because we want

139
00:09:17,970 --> 00:09:23,100
to actually add some data to the database for it we may want to get some data from the database.

140
00:09:23,100 --> 00:09:27,590
We need to actually create an object when I'm this is too late handler class.

141
00:09:28,070 --> 00:09:33,930
And in 9:27 as you can see I actually did declare an object of every adapter.

142
00:09:34,020 --> 00:09:40,470
So if you use this object in order to actually add some other data into our list view OK because we

143
00:09:40,470 --> 00:09:45,180
want to actually add some later on the list is going to actually get the data from the database and

144
00:09:45,180 --> 00:09:48,700
we want to show that it shows shows that are in our list view.

145
00:09:48,750 --> 00:09:50,520
So we need these up this object here.

146
00:09:50,520 --> 00:09:50,780
OK.

147
00:09:50,790 --> 00:09:53,210
Ali it after this is very important.

148
00:09:53,520 --> 00:09:56,760
And now let's go inside this uncreate Smurfit here.

149
00:09:56,790 --> 00:10:01,290
As you can see list I should instantiate these objects that we declared inside our class.

150
00:10:01,290 --> 00:10:06,560
For example these aren't computers these computers name this database handler and this adapter.

151
00:10:06,780 --> 00:10:11,790
So let's go inside these uncreate Meffert and now I'm going to pasting some lines of code here and then

152
00:10:11,820 --> 00:10:14,200
I'm going to explain to you what's going on here.

