1
00:00:00,840 --> 00:00:07,230
Okay now let's actually open this Android device monitor here as you can see we have this little Android

2
00:00:07,260 --> 00:00:08,050
image here.

3
00:00:08,070 --> 00:00:13,650
Click on it and it's going to open the Android device monitor for us.

4
00:00:13,890 --> 00:00:19,890
So as you can see here inside this Android device monitor application we have some taps here.

5
00:00:19,890 --> 00:00:23,850
So just a selectees file explorer tab as you can see here.

6
00:00:23,940 --> 00:00:26,840
Now let me actually make this area wider.

7
00:00:27,120 --> 00:00:29,670
And now as you can see if you have some files here.

8
00:00:29,720 --> 00:00:30,300
OK.

9
00:00:30,510 --> 00:00:33,810
We want to actually access these toilets about application.

10
00:00:33,810 --> 00:00:37,040
So as you can see here let me try to open it again.

11
00:00:37,840 --> 00:00:43,070
Now as you can see money still quit unexpectedly so this is a bug in our Android device Monita.

12
00:00:43,070 --> 00:00:49,450
So here I just need to reopen this application again here and now as you can see here we have these

13
00:00:49,540 --> 00:00:52,110
storage folder here as you can see here.

14
00:00:52,110 --> 00:00:54,360
I just need to open these stores folder.

15
00:00:54,460 --> 00:00:57,600
We have an emulator folder here as you can see.

16
00:00:57,670 --> 00:01:02,440
Open it and here we have a folder and the name of this folder is zero.

17
00:01:02,680 --> 00:01:06,440
And as you can see here we have these directories inside this folder.

18
00:01:06,460 --> 00:01:12,670
So if you don't have these directories in your Android device monitor as I have here as you can see

19
00:01:12,670 --> 00:01:20,380
alarm's directory and Android directory directory documents directory download directory movies directory

20
00:01:20,500 --> 00:01:28,130
you can actually create another directory of the custom name as the name of these directories that I

21
00:01:28,300 --> 00:01:28,840
have here.

22
00:01:28,840 --> 00:01:29,300
OK.

23
00:01:29,440 --> 00:01:34,500
So here in order to create another directory here you just need to select this a zero folder here.

24
00:01:34,570 --> 00:01:40,420
As you can see and then click on this plus button here and now you can actually create an order for

25
00:01:40,450 --> 00:01:40,750
there.

26
00:01:40,750 --> 00:01:41,270
Here.

27
00:01:41,440 --> 00:01:41,910
OK.

28
00:01:42,040 --> 00:01:48,970
So be sure to actually create a folder with the name as the name of these directories that I have here.

29
00:01:48,970 --> 00:01:55,500
For example movies directory with a capital M music directory with a capital M notification it's directory

30
00:01:55,750 --> 00:02:01,570
pictures directory Portchester directory and the victims directory or alarm's directory and then you

31
00:02:01,570 --> 00:02:02,550
can actually click on.

32
00:02:02,560 --> 00:02:02,940
OK.

33
00:02:03,010 --> 00:02:03,460
OK.

34
00:02:03,550 --> 00:02:09,260
So if you don't have these directories that I have here you can create these directories here.

35
00:02:09,460 --> 00:02:15,040
And as you can see here for example inside this download electively I created an order directed here

36
00:02:15,580 --> 00:02:20,590
by using the application and the name of this directory is these are download for example or some other

37
00:02:20,590 --> 00:02:22,540
name or inside these movies directly.

38
00:02:22,540 --> 00:02:25,440
I have another directory migrate to movies.

39
00:02:25,450 --> 00:02:26,830
OK I have another folder.

40
00:02:26,990 --> 00:02:31,910
So and then I can actually put some other files here and as you can see here at the top here.

41
00:02:31,970 --> 00:02:33,120
We have another option.

42
00:02:33,130 --> 00:02:38,020
For example this option here says pull a file from the device.

43
00:02:38,020 --> 00:02:44,080
So here we can actually pull another file from this device and put it on the desktop.

44
00:02:44,080 --> 00:02:51,280
So if I click on this button here now I can actually for example choose other options.

45
00:02:51,430 --> 00:02:51,920
OK.

46
00:02:52,060 --> 00:02:55,680
And then and then I can actually put put that there.

47
00:02:56,080 --> 00:03:01,090
And as you can see here because I selected these are my great movies folder here.

48
00:03:01,240 --> 00:03:03,840
It's going to actually take this file here.

49
00:03:03,940 --> 00:03:04,480
OK.

50
00:03:04,570 --> 00:03:06,570
And then create a copy from this file.

51
00:03:06,700 --> 00:03:12,310
And then for example here I need to actually specify a location for saving that file in my computer.

52
00:03:12,310 --> 00:03:17,240
And then if I click on the stop here and then click on for example open.

53
00:03:17,470 --> 00:03:21,050
Now it's going to actually put this folder inside in my on my desktop.

54
00:03:21,190 --> 00:03:26,670
So as you can see here this is my desktop and I have this directory migrates movies folder.

55
00:03:26,680 --> 00:03:27,280
OK.

56
00:03:27,520 --> 00:03:29,510
So here I can actually access this folder.

57
00:03:29,650 --> 00:03:35,350
And here I've actually pulled this folder from my device and here as you can see inside this hour a

58
00:03:35,350 --> 00:03:36,410
device monitor.

59
00:03:36,430 --> 00:03:39,850
I didn't do that by using this button here.

60
00:03:40,060 --> 00:03:46,330
And here if I click on this button here push a file onto the device I can actually write another file

61
00:03:46,600 --> 00:03:49,890
and put it inside this Android device monitor.

62
00:03:50,020 --> 00:03:53,200
So here for example instead I have a picture is directed here.

63
00:03:53,440 --> 00:03:58,570
And here I have my great pictures and here for example I have this image here.

64
00:03:58,660 --> 00:04:04,300
So here in order I have in order to actually delete a file from your Android device manager you just

65
00:04:04,300 --> 00:04:10,510
need to select it and then click on this minus button here as you can see delete the selection and then

66
00:04:10,510 --> 00:04:12,820
it actually deleted this image for me.

67
00:04:12,910 --> 00:04:19,390
And if we actually want to put another image into these pictures they're here I just need to select

68
00:04:19,390 --> 00:04:25,250
the spot in here and then in it on my desktop I have another image Tiger P in G.

69
00:04:25,300 --> 00:04:31,120
If I select it and then click on open here now it's going to actually put that image here inside my

70
00:04:31,270 --> 00:04:32,380
pictures folder.

71
00:04:32,380 --> 00:04:33,880
So here I have this image.

72
00:04:33,940 --> 00:04:34,830
OK.

73
00:04:35,260 --> 00:04:37,170
So hopefully that makes sense.

74
00:04:37,180 --> 00:04:45,930
And now let's actually go back to our Android studio so here after the end in curly brace of these uncreate

75
00:04:45,930 --> 00:04:51,390
method I'm going actually pasting method and then I'm going to explain to you what's going on here.

76
00:04:52,350 --> 00:04:55,890
So as you can see here I have these Smurfette here.

77
00:04:56,010 --> 00:04:57,120
OK.

78
00:04:57,250 --> 00:04:59,060
Public file.

79
00:04:59,130 --> 00:05:05,430
So as you can see the Axis modifier of this it is public and the return type of this method is file.

80
00:05:05,520 --> 00:05:06,110
OK.

81
00:05:06,240 --> 00:05:10,150
So this is going to actually return an object of type file.

82
00:05:10,170 --> 00:05:10,710
OK.

83
00:05:10,830 --> 00:05:15,790
And then the name of this method is return storage directory for folder name.

84
00:05:15,960 --> 00:05:16,520
OK.

85
00:05:16,710 --> 00:05:19,560
And this Meffert actually accepts two arguments.

86
00:05:19,560 --> 00:05:21,260
Strange directory name.

87
00:05:21,390 --> 00:05:21,820
OK.

88
00:05:21,960 --> 00:05:22,780
And strength.

89
00:05:22,860 --> 00:05:24,320
Name of folder.

90
00:05:24,580 --> 00:05:27,060
OK so what's what's this.

91
00:05:27,110 --> 00:05:28,220
It is going to do.

92
00:05:28,260 --> 00:05:34,200
As you can see here inside our Android monitor Android device monitor we have some directories here

93
00:05:34,200 --> 00:05:38,690
some default directories alarms DC and documents or downloads.

94
00:05:38,970 --> 00:05:43,740
And inside is actually as as you can see here inside these directories such as this and download the

95
00:05:43,740 --> 00:05:44,550
directory.

96
00:05:44,550 --> 00:05:47,190
I have another directory with this custom name.

97
00:05:47,450 --> 00:05:47,900
OK.

98
00:05:48,030 --> 00:05:54,450
So if I want to actually create a directory by using my Java codes in Android or here I just need to

99
00:05:54,450 --> 00:05:55,560
use this method here.

100
00:05:55,590 --> 00:06:00,720
As you can see returns storage directory for folder name directory name and name a folder.

101
00:06:00,750 --> 00:06:06,900
OK so I use the Smurfette in order to create a directory a custom directory in my and root directory

102
00:06:06,900 --> 00:06:09,030
as you can see here in my storage.

103
00:06:09,090 --> 00:06:09,720
OK.

104
00:06:10,140 --> 00:06:17,760
So here inside is inside the body of the Smurfit I created an object of type find and the name of this

105
00:06:18,210 --> 00:06:20,070
object is a file path.

106
00:06:20,070 --> 00:06:25,280
OK so it's going to actually give me the path of the file new file here.

107
00:06:25,290 --> 00:06:31,000
I want to create an object of type find an inside Apprentice's of this class.

108
00:06:31,020 --> 00:06:34,580
Fine as you can see it is either apprentices of this class name.

109
00:06:34,620 --> 00:06:36,620
So this is the constructor OK.

110
00:06:37,260 --> 00:06:43,130
I actually first of all it refers to the environment of the Android device as you can see here.

111
00:06:43,170 --> 00:06:47,300
Environment does get external storage public directory.

112
00:06:47,370 --> 00:06:53,340
So it's going to give me access to these storage directory here as you can see so we can actually access

113
00:06:53,340 --> 00:06:54,020
these files.

114
00:06:54,060 --> 00:06:55,320
OK.

115
00:06:55,980 --> 00:07:01,470
Get External storage public directory and inside Apprentice's I'll refer to the name of this directory

116
00:07:01,470 --> 00:07:03,500
name for example.

117
00:07:03,780 --> 00:07:06,300
I want to access the download directory.

118
00:07:06,330 --> 00:07:09,110
OK so that's this argument directory name.

119
00:07:09,120 --> 00:07:09,910
Come on.

120
00:07:09,990 --> 00:07:16,140
And the second argument is name of the name of the folder that you want to create inside that directory.

121
00:07:16,140 --> 00:07:19,660
For example these these are downloads and et cetera.

122
00:07:19,980 --> 00:07:28,060
As you can see here and here I created an if else statement if file path that make directories.

123
00:07:28,260 --> 00:07:32,610
If that actually did are the result of this expression is false.

124
00:07:32,740 --> 00:07:39,600
If it cannot actually create a directory with this directory name and name a folder OK.

125
00:07:39,620 --> 00:07:50,040
If this device is if this application cannot make a directory for actually creating a folder inside

126
00:07:50,140 --> 00:07:55,170
this directory name as you can see here for example I have this download folder and I want to create

127
00:07:55,350 --> 00:07:57,190
this directory and say This downloads folder.

128
00:07:57,540 --> 00:08:03,690
If I cannot do that if file path that make directories as you can see here M-K deals stance will make

129
00:08:03,690 --> 00:08:04,460
directories.

130
00:08:04,640 --> 00:08:10,690
So if not file path here I referred to this object not to make directories.

131
00:08:10,720 --> 00:08:17,250
If we cannot actually create a data directory to that specified directory name with that name or folder

132
00:08:17,730 --> 00:08:19,940
then it's going I should execute this line of code here.

133
00:08:19,950 --> 00:08:25,460
Let's create a toast so we can actually create this method here in a minute.

134
00:08:25,740 --> 00:08:29,250
Let's create a toast and then it's going to the shortest message to the user.

135
00:08:29,280 --> 00:08:32,110
There cannot be such directory in SD card.

136
00:08:32,240 --> 00:08:32,600
OK.

137
00:08:32,610 --> 00:08:33,690
Else.

138
00:08:33,690 --> 00:08:39,930
Else if we can actually create a directory in our in that specific directory name with that specific

139
00:08:39,930 --> 00:08:43,330
name or folder then it's going to actually show this message to the user.

140
00:08:43,500 --> 00:08:49,320
Let's create a toast your folder is created and its name is name a folder.

141
00:08:49,440 --> 00:08:50,020
OK.

142
00:08:50,100 --> 00:08:55,900
And then it's going to return this file path to the color of this method OK file path.

143
00:08:55,920 --> 00:08:59,430
So now this actually creates another method with this name.

144
00:08:59,430 --> 00:09:00,830
Let's create a toast.

145
00:09:00,870 --> 00:09:07,830
So here the public and the actually the return type of this method is Voyt and the name of this method

146
00:09:07,830 --> 00:09:08,550
is list.

147
00:09:08,580 --> 00:09:10,020
Let's create a toast.

148
00:09:10,110 --> 00:09:14,400
And this is going to is going to actually accept one argument of type string as a class as you can see

149
00:09:14,400 --> 00:09:14,830
here.

150
00:09:15,040 --> 00:09:17,110
There's three in message.

151
00:09:17,970 --> 00:09:21,610
And then I need to open and close this method by using these curly braces.

152
00:09:23,090 --> 00:09:26,910
And inside this method I need to create a host object.

153
00:09:27,140 --> 00:09:32,630
So as you can see here this is the line of code that I actually pasted here toast that may taste the

154
00:09:32,630 --> 00:09:34,610
first argument is the context.

155
00:09:34,610 --> 00:09:40,970
So I passed in the context for this activity main activity that this the second one is the message that

156
00:09:41,000 --> 00:09:44,930
I want to show to the user and the first one is the duration of the message that I want to show to the

157
00:09:44,930 --> 00:09:45,410
user.

158
00:09:45,560 --> 00:09:48,860
And then I need to call the Shoma fed on this object.

159
00:09:48,860 --> 00:09:49,700
OK.

160
00:09:50,030 --> 00:09:52,430
So now as you can see the error is gone.

161
00:09:52,840 --> 00:10:00,590
And remember that if we allow the user to access that the SD card in order to write some data on the

162
00:10:00,590 --> 00:10:03,780
card or to read some data from the SD card.

163
00:10:04,030 --> 00:10:07,700
OK then this Leffert is going I should return true.

164
00:10:07,790 --> 00:10:13,880
And then it's going to allow me to access the directed specific directory and with that specific name

165
00:10:13,880 --> 00:10:18,320
a name or folder and then it's going to show me this message your father is created and his name is

166
00:10:18,530 --> 00:10:20,360
for example name a folder OK.

167
00:10:20,420 --> 00:10:29,510
And if for example if the user denied to actually the application to used the SD card then this part

168
00:10:29,510 --> 00:10:35,630
of the code is going to be executed if not a file path that makes directories so the user of the application

169
00:10:35,630 --> 00:10:40,090
is not allowed to access the card and then dismiss it is going to be shown to the user.

170
00:10:40,130 --> 00:10:42,700
There cannot be such directory in SD card.

171
00:10:42,830 --> 00:10:43,230
OK.

172
00:10:43,280 --> 00:10:49,940
Or if we have for example an order for their name in that specific directory name.

173
00:10:49,940 --> 00:10:55,430
Again we cannot actually create an order for that in that in that directory and then it's going to again

174
00:10:55,640 --> 00:10:56,590
show me this message.

175
00:10:56,600 --> 00:10:59,020
There cannot be such directories in SD card.

176
00:10:59,030 --> 00:11:03,200
So now artists actually go inside this and click method here.

177
00:11:03,260 --> 00:11:08,330
And then there's actually I'm going actually pasting some lines of code here and then I'm going to explain

178
00:11:08,330 --> 00:11:10,250
to you what's going on here.

179
00:11:10,250 --> 00:11:14,530
So as you can see here these are the lines of code that I actually pasted here.

180
00:11:14,540 --> 00:11:17,550
I created a switch statement inside this.

181
00:11:17,570 --> 00:11:18,650
Unclear method.

182
00:11:18,800 --> 00:11:21,260
So now I want to explain to you what's going on here.

183
00:11:21,260 --> 00:11:27,200
First of all as you can see here I created a switch statement and inside the practices of the switch

184
00:11:27,200 --> 00:11:33,290
statement I referred to the name of this argument that is of type view or key that we see from these

185
00:11:33,350 --> 00:11:34,210
are unclear Smurfette.

186
00:11:34,250 --> 00:11:37,470
OK the DOT get ID.

187
00:11:37,580 --> 00:11:44,210
OK so it can actually switch between the IDs of the views or buttons as you can see here we have these

188
00:11:44,210 --> 00:11:47,450
buttons or I am the animal here.

189
00:11:47,660 --> 00:11:52,700
It's going to actually switch between those items and it can actually differentiate between those buttons.

190
00:11:52,700 --> 00:11:53,280
OK.

191
00:11:53,510 --> 00:11:57,530
So remember that button is actually a subclass of view.

192
00:11:57,630 --> 00:12:01,740
OK so we can actually be fair to what happens as we use.

193
00:12:01,760 --> 00:12:02,160
OK.

194
00:12:02,270 --> 00:12:05,220
So that's why we could actually refer to this here.

195
00:12:05,370 --> 00:12:06,550
That's good idea.

196
00:12:06,560 --> 00:12:11,600
So it's going to switch between those buttons and then we can actually differentiate between the clicking

197
00:12:11,840 --> 00:12:16,090
of the buttons that is inside our emulator here.

198
00:12:16,100 --> 00:12:17,990
As you can see inside that application.

199
00:12:18,020 --> 00:12:24,740
So for example we have we have this button here we have this button and defense buttons in our application.

200
00:12:25,040 --> 00:12:31,570
So here for example case if our thought Id that's between download directory.

201
00:12:31,770 --> 00:12:36,920
If for example the user clicks on this button let's make it directly to downloads folder OK.

202
00:12:37,100 --> 00:12:42,590
If the user clicks on the spot in our That ID that's between download directory then it's going to actually

203
00:12:42,590 --> 00:12:44,380
execute this line of code here.

204
00:12:44,380 --> 00:12:45,230
Return.

205
00:12:45,230 --> 00:12:51,360
So here I am referring to that specific method that that I actually created here as you can see here.

206
00:12:51,470 --> 00:12:57,190
Return storage directory for folder name so you can actually create a directory inside this or that.

207
00:12:57,240 --> 00:13:00,780
Inside the download directory that we have in our Android money.

208
00:13:00,860 --> 00:13:07,330
So as you can see here inside our downloads folder we can actually create a directory.

209
00:13:07,430 --> 00:13:14,360
So here as you can see I am saying that return storage directory for folder name environment directory

210
00:13:14,360 --> 00:13:15,140
downloads.

211
00:13:15,140 --> 00:13:17,090
So it can actually are repairing.

212
00:13:17,300 --> 00:13:23,040
We can actually filter these are directory download environment that directory downloads.

213
00:13:23,120 --> 00:13:27,220
And here for the second argument when it was specified a folder name.

214
00:13:27,260 --> 00:13:33,600
So it can actually create a folder called Nice called nice downloads as you can see here inside the

215
00:13:34,190 --> 00:13:35,390
directory downloads.

216
00:13:35,540 --> 00:13:36,030
OK.

217
00:13:36,140 --> 00:13:40,550
And then it's actually a break outside of this switch statement.

218
00:13:40,580 --> 00:13:45,380
So let me explain again here we are calling this Smurfette return storage directory for folder name

219
00:13:45,680 --> 00:13:47,840
environment that directory downloads.

220
00:13:47,840 --> 00:13:53,330
So it's so it can actually create a directory inside this downloads directory here inside the storage

221
00:13:53,330 --> 00:13:54,290
folder.

222
00:13:54,420 --> 00:13:56,300
And we did this with this name.

223
00:13:56,310 --> 00:13:57,330
Nice that.

224
00:13:57,440 --> 00:13:57,890
OK.

225
00:13:58,010 --> 00:14:02,750
So let's actually stop here and run our application and see what happens.

226
00:14:02,750 --> 00:14:07,300
So as you can see here all of the application is actually running on this emulator.

227
00:14:07,400 --> 00:14:13,820
And now if I want to actually make this keyboard this keyboard disappear I just click on this leather

228
00:14:13,820 --> 00:14:18,410
triangle here and now as you can see this keyboard is gone.

229
00:14:18,410 --> 00:14:20,770
And now as you can see I have this button.

230
00:14:20,810 --> 00:14:23,530
OK let's make a that to download directory.

231
00:14:23,550 --> 00:14:29,830
So I created as a case statement here case or that ID that between the download directory if the user

232
00:14:29,830 --> 00:14:33,950
clicks on the spot and then it's going to execute this line of code here.

233
00:14:34,270 --> 00:14:41,140
So let's actually click on this button here your folder is created and its name is nice downloads and

234
00:14:41,140 --> 00:14:42,440
now it's actually open.

235
00:14:42,450 --> 00:14:46,420
Are Android monitor as you can see here inside this download directory.

236
00:14:46,430 --> 00:14:47,690
We have this folder.

237
00:14:47,800 --> 00:14:49,940
Nice downloads as you can see here.

238
00:14:50,050 --> 00:14:50,520
OK.

239
00:14:50,620 --> 00:14:53,890
So now let's actually go back to what Android studio again here.

240
00:14:54,150 --> 00:15:02,590
Here we have this case here are that idea that between music directory if the user clicks on this button

241
00:15:02,590 --> 00:15:05,760
here let's make our directory to music folder.

242
00:15:05,930 --> 00:15:10,240
Or that idea that music throatily then is going to actually execute this line of code here.

243
00:15:10,240 --> 00:15:16,300
Return storage directory for folder name environment directory music.

244
00:15:16,440 --> 00:15:16,860
OK.

245
00:15:16,930 --> 00:15:23,440
So it's going to actually go inside this android monitor here as you can see if you have this music

246
00:15:23,440 --> 00:15:25,040
directory as you can see here.

247
00:15:25,210 --> 00:15:26,110
OK.

248
00:15:26,170 --> 00:15:29,010
And then it can actually go inside this music directory.

249
00:15:29,080 --> 00:15:33,980
So it's going to go inside is music directory as you can see here for example.

250
00:15:34,090 --> 00:15:38,800
And then it's going to actually create a folder with this name.

251
00:15:38,830 --> 00:15:41,260
Nice musics as you can see here.

252
00:15:41,380 --> 00:15:44,090
And then it's going to break out of this switch statements.

253
00:15:44,110 --> 00:15:46,080
So it's actually so.

254
00:15:46,120 --> 00:15:52,550
Now in our are actually as you can see here in our emulator now to actually click on this button.

255
00:15:52,690 --> 00:15:55,790
Let's make a directory to music folder.

256
00:15:55,810 --> 00:16:01,700
So if I click on it now it says your folder is created and its name is nice musics.

257
00:16:01,770 --> 00:16:07,210
So let's actually open our and rate monitor and now inside this music directory we can see this Walder

258
00:16:07,380 --> 00:16:08,410
nice music.

259
00:16:08,660 --> 00:16:09,260
OK.

260
00:16:10,480 --> 00:16:16,270
And now we have another case statement here are that idea that PTEN documents folder.

261
00:16:16,420 --> 00:16:22,930
So it's going actually as you can see here if the user clicks on the clicks on this button here let's

262
00:16:22,930 --> 00:16:24,960
make a directory to documents folder.

263
00:16:25,150 --> 00:16:30,280
Then it can actually create for example a folder with this name.

264
00:16:30,280 --> 00:16:36,250
Nice documents inside this directory environment that directory documents.

265
00:16:36,250 --> 00:16:39,590
And in our Android device monitor as you can see here.

266
00:16:39,700 --> 00:16:45,070
If I open these documents folder here now you can see this file here.

267
00:16:45,100 --> 00:16:46,450
Nice documents.

268
00:16:46,480 --> 00:16:47,590
You can see this folder.

269
00:16:47,680 --> 00:16:47,960
OK.

270
00:16:47,980 --> 00:16:49,420
Nice comments.

271
00:16:49,510 --> 00:16:56,370
And now we have another case statements case statement are that Id thoughts are between link ringtones

272
00:16:56,380 --> 00:16:56,870
folder.

273
00:16:56,890 --> 00:17:05,170
So if the user clicks on this button let's make our directory to our ringtones folder as you can see

274
00:17:05,170 --> 00:17:06,150
here.

275
00:17:06,310 --> 00:17:12,240
And then this line of code is going to be executed return storage directory for a folder name environment

276
00:17:12,610 --> 00:17:14,140
that directory ringtones.

277
00:17:14,200 --> 00:17:19,940
So it can actually go inside the house and really monitor as you can see here we have a directory called

278
00:17:19,960 --> 00:17:20,690
ringtones.

279
00:17:20,770 --> 00:17:24,560
As you can see here it's actually find districted here.

280
00:17:24,570 --> 00:17:26,070
It is the directory.

281
00:17:26,380 --> 00:17:31,180
And inside this directory is going to actually create a folder with that name.

282
00:17:31,250 --> 00:17:33,010
Nine nice ringtones.

283
00:17:33,010 --> 00:17:33,840
OK.

284
00:17:33,850 --> 00:17:37,590
So let's actually go inside our emulator.

285
00:17:37,750 --> 00:17:42,950
And now I want to actually click on the spot and let's make our directory touring tours folder.

286
00:17:43,240 --> 00:17:46,980
And it says your folder is created and its name is nice.

287
00:17:47,010 --> 00:17:48,320
All right ringtones.

288
00:17:48,520 --> 00:17:50,290
And here we can see these folders.

289
00:17:50,440 --> 00:17:54,040
Nice ring tones inside our ringtones directory.

290
00:17:54,490 --> 00:17:55,750
And now let's get you to go inside.

291
00:17:55,750 --> 00:17:58,350
These are Android stood you here.

292
00:17:58,750 --> 00:18:02,840
And if you have these are that I.D. that Pythian pod cast for there.

293
00:18:02,890 --> 00:18:08,500
Again this can actually go inside this podcast directory and then it's going to create this folder.

294
00:18:08,530 --> 00:18:09,970
Nice podcasts.

295
00:18:10,000 --> 00:18:14,960
So let's actually open our emulator here are here I want to actually create.

296
00:18:15,040 --> 00:18:16,380
Click on this button.

297
00:18:16,660 --> 00:18:23,260
Let's make a directory to podcast folder and it says your father is created and its name is nice podcasts

298
00:18:23,590 --> 00:18:30,930
and now in our Android monitor let's actually find the podcast directory here.

299
00:18:31,180 --> 00:18:33,640
For example this is our podcast directory.

300
00:18:33,640 --> 00:18:37,560
And if I open it now we can see these folders nice podcasts.

301
00:18:37,660 --> 00:18:43,760
And if I actually click on this button here again let's make a directory to podcast folder.

302
00:18:43,780 --> 00:18:49,990
Now it says there cannot be such directory in SD card because we already have this folder with this

303
00:18:49,990 --> 00:18:50,850
name here.

304
00:18:50,860 --> 00:18:54,730
OK so it cannot actually create the same folder twice.

305
00:18:54,730 --> 00:19:00,880
So let's actually go back inside our Android studio here we have movies folder here it's going to truly

306
00:19:00,910 --> 00:19:07,510
create a directory environment that directory movies nice movies and plan for their environment that

307
00:19:07,560 --> 00:19:08,630
created the alarms.

308
00:19:08,650 --> 00:19:09,730
Nice alarms.

309
00:19:09,730 --> 00:19:14,620
And here we have pictures for their environment that directory pictures nice pictures.

310
00:19:14,620 --> 00:19:17,790
So let's go back in our hour emulator.

311
00:19:17,950 --> 00:19:23,150
And now if we want to actually click on this button let's make a directory to move movies folder.

312
00:19:23,380 --> 00:19:26,140
And it says your father is created and its name is.

313
00:19:26,140 --> 00:19:27,220
Nice movies.

314
00:19:27,220 --> 00:19:35,470
So now if I open our Android device monitor now here inside our movies folder we have these nice movies

315
00:19:35,470 --> 00:19:37,560
directory as you can see here.

316
00:19:37,630 --> 00:19:43,780
Now if I actually click on these for example this let's make I directed it to pictures folder.

317
00:19:43,810 --> 00:19:48,640
Now if I actually open my pictures folder here it says Nice pictures.

318
00:19:48,640 --> 00:19:53,050
Now if I actually click on this little match I directed it to alarm's folder again.

319
00:19:53,360 --> 00:19:57,460
It's directory is created on here inside our alarm's folder.

320
00:19:57,580 --> 00:20:00,000
I have these nice alarms here.

321
00:20:00,130 --> 00:20:00,730
OK.

322
00:20:00,940 --> 00:20:03,030
So hopefully that makes sense.

323
00:20:03,160 --> 00:20:08,260
And now it's actually putting some more lines of code in our class and then I'm going to explain to

324
00:20:08,260 --> 00:20:09,720
you what's going on here.

325
00:20:09,820 --> 00:20:17,950
OK so now I want to actually save RTX the file in my Actually in my documents folder as you can see

326
00:20:17,950 --> 00:20:18,500
here.

327
00:20:18,820 --> 00:20:25,780
For example I went to actually typing typing something here in this on this textfield here and there

328
00:20:25,840 --> 00:20:32,380
I want to actually click on these saved documents folder in as the cart button and then it can actually

329
00:20:32,380 --> 00:20:35,770
create a text file in my documents folder.

330
00:20:35,770 --> 00:20:42,040
So as you can see here in an Android device monitor here I have these documents folder and I want to

331
00:20:42,040 --> 00:20:45,360
actually create a text file in these documents folder.

332
00:20:45,580 --> 00:20:46,230
OK.

333
00:20:46,510 --> 00:20:52,660
And then I'm going to actually put in the values that the user enter in say these are added text here

334
00:20:53,050 --> 00:20:57,080
and then can actually put these values in that are certified.

335
00:20:57,160 --> 00:20:57,510
OK.

336
00:20:57,580 --> 00:20:59,230
So let's see how we can do that.

337
00:20:59,440 --> 00:21:05,950
Let's go back to our Android studio and here I want to actually pasted our method here and then I'm

338
00:21:05,950 --> 00:21:08,740
going to explain to you what's going on here.

339
00:21:08,980 --> 00:21:12,910
So as the here this is them after they actually paste that here as you can see.

340
00:21:12,910 --> 00:21:17,170
So as you can see here the access modifier of this method is public.

341
00:21:17,410 --> 00:21:19,650
The return type of this Smurfit is void.

342
00:21:19,930 --> 00:21:26,980
The name of the Smurfit is let's say file two documents folder and this if it doesn't accept any arguments

343
00:21:27,550 --> 00:21:32,380
and as you can see here inside the body of the Smurfit I have these lines of code here.

344
00:21:32,380 --> 00:21:36,220
First of all I created an object of type find.

345
00:21:36,370 --> 00:21:37,080
OK.

346
00:21:37,150 --> 00:21:39,450
And the name of this object is a file path.

347
00:21:39,460 --> 00:21:47,410
So it's going to actually give me the file path to that specific defined so file file path assignment

348
00:21:47,440 --> 00:21:50,060
operator new file.

349
00:21:50,290 --> 00:21:56,370
So as you can see here inside the prentices environment that gets external storage public directories

350
00:21:56,380 --> 00:22:03,730
so it can actually give me access to the SD card to get external storage or public directory environment

351
00:22:03,790 --> 00:22:05,320
that directory documents.

352
00:22:05,320 --> 00:22:11,500
So I want to actually access the documents folder and then I want to actually put this file in in that

353
00:22:11,890 --> 00:22:12,880
directory.

354
00:22:12,910 --> 00:22:14,900
Nice file that the.

355
00:22:15,340 --> 00:22:19,980
So here we have a try catch exception exception here as you can see.

356
00:22:19,990 --> 00:22:24,960
So inside this a statement as you can see I have file output stream.

357
00:22:25,030 --> 00:22:32,660
So this object can actually help me to actually output some file to some directories to some files so

358
00:22:32,690 --> 00:22:33,860
file path.

359
00:22:33,980 --> 00:22:40,670
So so file output string and the name of this object is a file output stream new file output stream.

360
00:22:40,720 --> 00:22:45,760
And here we need to pass the path that you want to actually save that object.

361
00:22:45,760 --> 00:22:47,930
For example this nice find that 60.

362
00:22:47,980 --> 00:22:49,180
So here is the path.

363
00:22:49,200 --> 00:22:50,180
OK.

364
00:22:50,520 --> 00:22:53,640
And here as you can see output stream writer.

365
00:22:53,840 --> 00:23:01,270
OK so here I have an object of type output stream writer and the name of this object is output stream

366
00:23:01,270 --> 00:23:02,040
writer.

367
00:23:02,050 --> 00:23:08,500
So let's actually go back to our Android documentation and let's see what does these objects do ok for

368
00:23:08,500 --> 00:23:12,050
example this file output stream or the output stream later.

369
00:23:12,100 --> 00:23:19,180
So now let's actually open our browser and now our I mean the Android documentation developer that Android

370
00:23:19,180 --> 00:23:25,610
dot com and inside the search bar here I want to actually search for file output stream.

371
00:23:25,630 --> 00:23:30,020
So here as you can see I have this fight output stream here Android API.

372
00:23:30,370 --> 00:23:35,890
And as you can see here this class is a public class and this class actually extends from the output

373
00:23:35,890 --> 00:23:36,720
stream class.

374
00:23:36,790 --> 00:23:37,400
OK.

375
00:23:37,780 --> 00:23:43,750
And here as you can see this output stream class action is fight with stream class extends from this

376
00:23:43,750 --> 00:23:48,360
output stream class and this output stream class extends from this object class.

377
00:23:48,370 --> 00:23:55,170
So here we have some direct subclasses parsel file descriptor and auto output stream.

378
00:23:55,270 --> 00:24:01,600
And here as you can see we have some oughtnt known indirect class subclasses assets file descriptor

379
00:24:01,600 --> 00:24:03,550
and auto closed output stream.

380
00:24:03,790 --> 00:24:09,640
So here is that is the description for this file output stream class of file output stream is an output

381
00:24:09,640 --> 00:24:17,640
stream for writing data to a file or to a file descriptor whether or not a file is available or maybe

382
00:24:17,650 --> 00:24:20,970
created depends upon the underlying platform.

383
00:24:21,220 --> 00:24:29,260
Some platforms in particular allow a file to be opened for writing by only one file output stream or

384
00:24:29,320 --> 00:24:32,050
other file writing object at a time.

385
00:24:32,110 --> 00:24:38,820
In such situations the constructor in this class will fail if the file involved is already open.

386
00:24:38,970 --> 00:24:47,380
OK so fall out with file output stream is meant for writing streams of raw bytes such as image data

387
00:24:47,950 --> 00:24:50,310
for writing streams of characters.

388
00:24:50,470 --> 00:24:52,540
Considering using file writer.

389
00:24:52,720 --> 00:24:53,280
OK.

390
00:24:53,440 --> 00:24:54,910
And here we have some summary.

391
00:24:54,940 --> 00:25:01,310
Probably constructor's file output stream name file with stream name are boolean append.

392
00:25:01,450 --> 00:25:06,810
So it creates a file with the output stream to write to the file with a specified name.

393
00:25:06,960 --> 00:25:14,200
OK and we have file output stream file creates a file output stream to write to the file represented

394
00:25:14,200 --> 00:25:16,710
by the specified file object.

395
00:25:16,810 --> 00:25:22,900
If you have a fight with a stream file boolean append and here as you can see creates a file output

396
00:25:22,900 --> 00:25:30,240
stream to write to the file represented by this specified file object file with the stream file descriptor.

397
00:25:30,370 --> 00:25:30,860
OK.

398
00:25:31,000 --> 00:25:37,210
And we have some public methods which we can use on the file output stream object as you can see here.

399
00:25:37,270 --> 00:25:40,520
We have finalized Meffert and we have some other methods.

400
00:25:40,720 --> 00:25:43,880
So here as you can see we used this method.

401
00:25:44,080 --> 00:25:49,660
OK first of all I created an object of type file output stream and then as you can see I actually assigned

402
00:25:49,720 --> 00:25:51,780
this path to the constructor.

403
00:25:51,820 --> 00:25:56,060
So here as you can see we use this constructor here.

404
00:25:56,160 --> 00:26:02,320
It creates a file output stream to write to the file represented by the specified object.

405
00:26:02,320 --> 00:26:05,220
OK so here we have it out with the string here.

406
00:26:05,320 --> 00:26:08,590
I created an output stream of writer object.

407
00:26:08,620 --> 00:26:12,150
So let's see what the output stimulated right Optik outputs

408
00:26:14,620 --> 00:26:24,230
stream writer so as you can see here inside the Android API we have this upped class output stream right

409
00:26:24,230 --> 00:26:24,800
here.

410
00:26:25,170 --> 00:26:28,800
And as you can see here this is a public class output stream.

411
00:26:28,800 --> 00:26:29,140
Right.

412
00:26:29,160 --> 00:26:32,210
And this class extends from the writer class.

413
00:26:32,670 --> 00:26:38,730
And here it is there as you can see we can see that this output stream right the class is inheriting

414
00:26:38,790 --> 00:26:45,390
all of the features and behaviors of this writer class and this writer class inherits all of the features

415
00:26:45,690 --> 00:26:47,640
and behaviors of this object class.

416
00:26:47,760 --> 00:26:51,680
And here we have known subclasses file writer.

417
00:26:51,750 --> 00:26:57,760
So here is the description of this output stream right here and output stream writer is a breach from

418
00:26:57,780 --> 00:27:05,610
characteris streams to byte streams characters written tweets are encoded into bytes using a specified

419
00:27:05,610 --> 00:27:13,350
charset the charset that it used that it uses maybe specified by name or maybe even explicitly or the

420
00:27:13,350 --> 00:27:20,460
platform's default charset may be except that each invocation of a right method causes the encoding

421
00:27:20,460 --> 00:27:29,190
converter to be invoked on the given characters the resulting bytes are accumulated in a buffer before

422
00:27:29,400 --> 00:27:33,240
being written to the to the underlying output stream.

423
00:27:33,450 --> 00:27:41,420
The size of this buffer may be specified specified but by default it is a large enough for most purposes.

424
00:27:41,470 --> 00:27:48,210
OK so if we can specify the size of the buffer but by default it is large enough for most purposes.

425
00:27:48,630 --> 00:27:54,960
Note that the characters passed to the right methods are not buffered for top efficiency.

426
00:27:54,960 --> 00:28:01,620
Consider wrapping an output string later within a buffer iterator so as to avoid frequent converters

427
00:28:01,950 --> 00:28:10,200
invocations for example we have an example here as you can see and here we have some other descriptions.

428
00:28:10,200 --> 00:28:12,570
So let's go back to what Android studio here.

429
00:28:12,570 --> 00:28:17,970
We have an output stream right an object output stream new output stream file output stream.

430
00:28:18,030 --> 00:28:24,040
Ok so it can actually convert this object file output stream into bytes.

431
00:28:24,060 --> 00:28:28,810
As you can see here it says characters written to it are encoded into bytes.

432
00:28:28,850 --> 00:28:29,460
OK.

433
00:28:29,850 --> 00:28:34,820
And here we have actually DMF it's the constructor's as you can see here.

434
00:28:34,830 --> 00:28:38,880
Output stream out with street and other constructors.

435
00:28:38,910 --> 00:28:39,660
OK.

436
00:28:39,930 --> 00:28:46,000
So here as you can see here I referred to the name of this object output stream right here.

437
00:28:46,050 --> 00:28:47,270
That's the abend.

438
00:28:47,470 --> 00:28:51,100
OK here I want to actually append some data to this output.

439
00:28:51,120 --> 00:28:52,350
Inviter OK.

440
00:28:52,560 --> 00:28:53,670
EDT value here.

441
00:28:53,700 --> 00:28:55,920
I referred to this object.

442
00:28:55,920 --> 00:29:01,010
It is de-value Let's actually open our emulator as you can see we have this Edhi text here.

443
00:29:01,020 --> 00:29:06,570
I want to actually append the values that the user enter are in this text.

444
00:29:06,570 --> 00:29:09,750
I want to append this value to this output assimilator object.

445
00:29:09,750 --> 00:29:10,130
OK.

446
00:29:10,180 --> 00:29:12,430
It is the body that takes the two strings.

447
00:29:12,570 --> 00:29:12,970
OK.

448
00:29:13,020 --> 00:29:17,970
And here I referred to the name of this object agame output stream right at that close.

449
00:29:17,970 --> 00:29:23,790
So we need to close this output stream later and then we need to close this file output stream close

450
00:29:23,880 --> 00:29:31,680
as you can see here we have to close this object before we actually reach the end of this curly braces

451
00:29:31,680 --> 00:29:33,620
for this Troy statement.

452
00:29:33,720 --> 00:29:36,490
As you can see here file output with streamlet close.

453
00:29:36,690 --> 00:29:42,740
And then here I want to show a message to the user that the file is actually saved in the SD card.

454
00:29:42,810 --> 00:29:43,310
OK.

455
00:29:43,380 --> 00:29:45,520
Let's create a toast saved.

456
00:29:45,570 --> 00:29:46,190
OK.

457
00:29:46,560 --> 00:29:49,940
And that here we have a catch statement catch exception.

458
00:29:49,950 --> 00:29:56,890
So if the if some errors happen during the for example saving the data out the in the SD card then it

459
00:29:56,940 --> 00:30:02,310
can actually catch the exception lock that I lug it out with string so it's going to actually give me

460
00:30:02,580 --> 00:30:05,690
a string representation of the exception that has occurred.

461
00:30:05,850 --> 00:30:08,100
And then I want to show a message to the user.

462
00:30:08,130 --> 00:30:11,140
Let's create a tossed exception occurred check the lock.

463
00:30:11,220 --> 00:30:12,350
For more info.

464
00:30:12,590 --> 00:30:17,770
Ok so now let's actually go back to our unclear method as you can see here.

465
00:30:18,190 --> 00:30:20,760
Now I want to create another case statement.

466
00:30:20,760 --> 00:30:24,840
Chase are thought Id dot PTEN.

467
00:30:24,840 --> 00:30:26,650
Safe flight.

468
00:30:26,730 --> 00:30:30,080
OK let's let me actually create a break statement here.

469
00:30:30,090 --> 00:30:35,250
So if the user clicks on this for example it's opened the emulator.

470
00:30:35,310 --> 00:30:40,590
If they use it click on the spot in say two documents folder in SD card.

471
00:30:40,790 --> 00:30:47,440
OK I want to actually get the data that is inside this edit text here and then I want to actually save

472
00:30:47,440 --> 00:30:54,050
it in a text file inside the SD card inside the documents folder documents directory.

473
00:30:54,270 --> 00:31:00,330
So let's see how we can do that first because we have a method here that does actually do this job for

474
00:31:00,330 --> 00:31:03,210
us saving that data to documents folder.

475
00:31:03,360 --> 00:31:05,520
Here I just need to refer to the Smurfette.

476
00:31:06,090 --> 00:31:12,580
And here I just can't just type in let's say file two documents folder.

477
00:31:12,960 --> 00:31:13,580
OK.

478
00:31:13,980 --> 00:31:18,930
And now let's actually run our project and see what happens.

479
00:31:18,930 --> 00:31:23,590
So now as you can see here our application is actually running on this emulator.

480
00:31:23,700 --> 00:31:24,300
OK.

481
00:31:24,510 --> 00:31:27,060
And now here this is our textfield here.

482
00:31:27,090 --> 00:31:28,090
This is our editor.

483
00:31:28,290 --> 00:31:31,260
And now we want to actually for example type in my own name.

484
00:31:31,410 --> 00:31:32,600
Mortiser.

485
00:31:32,880 --> 00:31:37,690
And then let's let me actually disappear this keyboard and now I want to actually click on the spot

486
00:31:37,720 --> 00:31:41,050
and save it to documents folder in as the cost.

487
00:31:41,130 --> 00:31:42,520
And it is saved.

488
00:31:42,780 --> 00:31:46,230
So let's actually open or open our Android device monitor.

489
00:31:46,590 --> 00:31:49,020
And let's actually find the documents directory.

490
00:31:49,020 --> 00:31:51,930
So this is our documents directory and this is my file.

491
00:31:51,990 --> 00:31:53,660
Nice file that you see.

492
00:31:53,790 --> 00:32:00,930
So remember in our Android studio when I actually created that Mefford let's say file to documents folder

493
00:32:00,960 --> 00:32:02,060
as you can see here.

494
00:32:02,160 --> 00:32:05,540
I decided to create a text file with this name.

495
00:32:05,550 --> 00:32:09,040
Nice find and in an Android device monitor you can see these files.

496
00:32:09,060 --> 00:32:13,610
So let's actually put this file in the on the desktop.

497
00:32:13,710 --> 00:32:19,200
So I just need to click on this button and then here is going to ask me to save this file here.

498
00:32:19,240 --> 00:32:23,360
I want to save it on the desktop and then click on Save.

499
00:32:23,460 --> 00:32:25,700
So let's actually go back to our desktop.

500
00:32:25,710 --> 00:32:29,620
So as you can see here this is my desktop and this is my file.

501
00:32:29,670 --> 00:32:31,280
Nice file that takes the.

502
00:32:31,410 --> 00:32:33,660
And now if I open it let's see what happens.

503
00:32:33,660 --> 00:32:37,000
And as you can see here I have this value here mortars.

504
00:32:37,140 --> 00:32:37,940
OK.

505
00:32:38,400 --> 00:32:42,690
And that is the same value that I entered inside this edit text.

506
00:32:42,690 --> 00:32:44,940
So now it's actually to change the value.

507
00:32:44,970 --> 00:32:48,000
For example I want to type in another thing for example.

508
00:32:48,000 --> 00:32:49,420
Nice.

509
00:32:50,350 --> 00:32:56,400
And now let me actually make this keyboard disappear and if I click on this button again it says safe.

510
00:32:56,430 --> 00:32:57,150
OK.

511
00:32:57,150 --> 00:33:00,590
So let's actually open our Android device monitor again.

512
00:33:00,600 --> 00:33:04,010
So as a test here this is my Android device monitor.

513
00:33:04,050 --> 00:33:07,950
And here again I want to actually put this awide in my desktop.

514
00:33:08,040 --> 00:33:12,850
So here I just need to select it and click on the spot in safe.

515
00:33:13,080 --> 00:33:17,870
And now if I click double click on these textfile here again.

516
00:33:17,880 --> 00:33:24,160
And now let me actually open this nice file that takes the fight again and here again we can see this

517
00:33:24,180 --> 00:33:24,950
value.

518
00:33:24,960 --> 00:33:25,760
Nice.

519
00:33:26,090 --> 00:33:26,680
OK.

520
00:33:27,000 --> 00:33:28,670
So hopefully that makes sense.

521
00:33:28,830 --> 00:33:32,460
And now here I want to do another thing here here.

522
00:33:32,580 --> 00:33:39,060
I want to let the user to click on this button retrieve the information from the SD card and then get

523
00:33:39,060 --> 00:33:40,620
this value that is inside.

524
00:33:40,640 --> 00:33:42,680
This takes the file and put it inside.

525
00:33:42,680 --> 00:33:44,390
These are text view here.

526
00:33:44,490 --> 00:33:44,950
OK.

527
00:33:45,120 --> 00:33:46,760
So let's see how we can do that.

528
00:33:46,770 --> 00:33:50,070
So let's actually open the Android studio.

529
00:33:50,190 --> 00:33:53,580
So now I want to actually do another film here.

530
00:33:53,730 --> 00:33:59,070
For example when the user clicks on these button as you can see here and the user clicks on this button

531
00:33:59,230 --> 00:34:04,770
all you want to get the data that is inside that the inside of the file that we actually saved when

532
00:34:04,770 --> 00:34:08,260
the user clicks on these CB2 documents folder in SD card.

533
00:34:08,460 --> 00:34:15,840
I want to get those data that is actually inside of that specific to the file and then display it here

534
00:34:15,990 --> 00:34:17,580
and these are tapes view here.

535
00:34:17,640 --> 00:34:25,200
So in order to do that job here first need to actually create a method here inside of our main activity

536
00:34:25,200 --> 00:34:25,940
class.

537
00:34:26,010 --> 00:34:31,560
So after the end in curly brace of these or let's say five to eight commands for the effort he had to

538
00:34:31,560 --> 00:34:32,800
actually create Smurfette.

539
00:34:32,850 --> 00:34:33,290
OK.

540
00:34:33,450 --> 00:34:37,470
So I'm going to paste in my fate on the head here and then I'm going to explain to you what's going

541
00:34:37,470 --> 00:34:38,120
on here.

542
00:34:38,130 --> 00:34:43,630
So as you can see here this is the method that they actually pasted here inside this main activity class.

543
00:34:43,650 --> 00:34:44,160
OK.

544
00:34:44,310 --> 00:34:48,480
So first of all let me tell you that the access modifier of this method is public.

545
00:34:48,660 --> 00:34:54,870
The return type of this method is Voyt and the name of the Smif is let's retrieve five data up from

546
00:34:54,870 --> 00:34:59,260
documents folder and this method is not going to accept any arguments.

547
00:34:59,460 --> 00:35:04,680
So as you can see here inside the body of the Smurfette we have some lines of code here.

548
00:35:04,680 --> 00:35:08,140
So first of all I created an object of type file.

549
00:35:08,220 --> 00:35:08,710
OK.

550
00:35:08,850 --> 00:35:11,480
And the name of this object is file path.

551
00:35:11,550 --> 00:35:18,660
And as you can see here if you have an object of type find new file and inside the practices as you

552
00:35:18,660 --> 00:35:23,370
can see environment does get external storage public directory.

553
00:35:23,370 --> 00:35:29,280
So here you want to access the SD card environment that directory documents and you want to access the

554
00:35:29,280 --> 00:35:32,300
documents folder inside the SD card.

555
00:35:32,400 --> 00:35:38,390
So now as you can see for such an argument I need to actually give the name of the file.

556
00:35:38,460 --> 00:35:40,110
Nice file that takes the.

557
00:35:40,210 --> 00:35:43,680
So I can see here you have the next the same file here.

558
00:35:43,680 --> 00:35:44,740
Nice file that.

559
00:35:44,880 --> 00:35:45,670
As you can see.

560
00:35:45,740 --> 00:35:50,290
But here inside the Smurfette let's say file two documents folder.

561
00:35:50,310 --> 00:35:57,630
I just wanted to actually save this file inside the SD card but for the Smurfette in here I want to

562
00:35:57,630 --> 00:36:04,110
actually get the data that is inside of this wide nice file that you XTi so be sure that that that the

563
00:36:04,110 --> 00:36:09,790
name of this file is the same as the name of this flight that you actually put inside these let's say

564
00:36:09,800 --> 00:36:11,960
filed two documents with their method.

565
00:36:12,230 --> 00:36:20,680
So now as you can see here we have a try catch accept statement here OK try and here as you can see

566
00:36:20,860 --> 00:36:26,380
inside these curly braces here I have an object of type file input stream.

567
00:36:26,450 --> 00:36:26,720
OK.

568
00:36:26,720 --> 00:36:29,730
And the name of this object these file input is Stream.

569
00:36:29,780 --> 00:36:36,230
And here I want to actually create an object of type file file input stream by just putting the new

570
00:36:36,230 --> 00:36:40,360
keyboard file input stream file path as you can see here.

571
00:36:40,370 --> 00:36:45,820
So here I give this a file path here to the constructor of this flight input stream.

572
00:36:45,830 --> 00:36:50,580
So let's actually go inside the documentation in order to see what is this fight input stream.

573
00:36:50,660 --> 00:36:55,570
So file input string.

574
00:36:55,620 --> 00:36:57,890
So here I can't just select it.

575
00:36:58,080 --> 00:37:01,340
And now here is the documentation for this class.

576
00:37:01,620 --> 00:37:04,490
And as you can see here this class is actually a public class.

577
00:37:04,590 --> 00:37:12,210
And as you can see this class extends from the input stream class and now we have some direct some classes

578
00:37:12,270 --> 00:37:15,140
and some and some indirect subclasses.

579
00:37:15,510 --> 00:37:24,030
And here it says a file input stream obtains input bytes from a file in a file system what files are

580
00:37:24,030 --> 00:37:31,350
available depends on the host environment file input stream is meant for reading streams of raw bytes

581
00:37:31,530 --> 00:37:37,710
such as image data for reading streams of characters consider using a file reader.

582
00:37:38,190 --> 00:37:40,890
So here is the summary file input stream.

583
00:37:40,950 --> 00:37:47,040
And here we can see the constructors and here we can see the methods that is related to this class.

584
00:37:47,340 --> 00:37:54,600
And now as you can see we have 5 input stream in order to read the data that is inside the nice fidelity

585
00:37:54,690 --> 00:37:55,440
XTi.

586
00:37:55,740 --> 00:38:00,040
And here I have a buffered reader object so buffered the reader here.

587
00:38:00,100 --> 00:38:06,180
If you have a buffer to read or object as you can see here a new buffer the reader and as you can see

588
00:38:06,180 --> 00:38:12,420
inside the prentices I created another object by putting the new keyboard new input stream reader.

589
00:38:12,480 --> 00:38:18,090
So first of all let's go inside the documentation in order to see what is the Spofforth reader.

590
00:38:18,090 --> 00:38:22,220
So let's actually open our browser here inside the search bar.

591
00:38:22,410 --> 00:38:25,620
I just need to put this a class name buffer at the reader.

592
00:38:25,620 --> 00:38:26,130
Double that.

593
00:38:26,130 --> 00:38:28,910
Are you that Buffle reader inside the Android API eyes.

594
00:38:28,920 --> 00:38:35,160
And now let's see what is this class Puplick class Spofforth reader extends the reader class OK.

595
00:38:35,530 --> 00:38:42,780
And as you can see here it says Reith's text from a character input stream buffer into characters so

596
00:38:42,780 --> 00:38:48,360
as to provide for the efficient reading of characters arrows and lines.

597
00:38:48,360 --> 00:38:53,540
Def buffer size may be specified or the default size may be used.

598
00:38:53,630 --> 00:38:57,040
The default is large enough for most purposes.

599
00:38:57,210 --> 00:39:04,440
In general each read request made of a reader causes a corresponding greet request to be made up.

600
00:39:04,470 --> 00:39:08,070
Underline character of byte stream.

601
00:39:08,100 --> 00:39:15,450
It is therefore advisable to wrap a buffer reader around any reader who's read operations may be costly

602
00:39:15,450 --> 00:39:18,790
such as file readers and input stream readers.

603
00:39:18,900 --> 00:39:22,410
So as you can see here we have this example here.

604
00:39:22,410 --> 00:39:25,050
So now let's actually go back to what I wrote stood studio.

605
00:39:25,080 --> 00:39:29,100
So here we have the Spufford that object in order to read the data.

606
00:39:29,460 --> 00:39:32,550
And here we have our input the stream reader.

607
00:39:32,550 --> 00:39:41,320
OK so let's actually go inside the documentation in order to search for the input stream reader.

608
00:39:41,340 --> 00:39:42,510
So let's actually click on it.

609
00:39:42,510 --> 00:39:48,810
So now here you can see the documentation for input stream reader class as you can see this class extends

610
00:39:49,020 --> 00:39:55,210
from the reader class and here it says an input stream reader is a breach from byte streams to the character

611
00:39:55,220 --> 00:40:02,340
streams it reads bytes and decode them into characters using a specified charset the charset that it

612
00:40:02,340 --> 00:40:10,400
uses may be specified by name or may be given explicitly or the platform's default charset may be accepted.

613
00:40:10,440 --> 00:40:18,000
Each invocation of one of an input streams reader read methods may cause one or more bytes to be read

614
00:40:18,330 --> 00:40:25,740
from the underlying byte input stream to enable the efficient conversion of bytes to characters more

615
00:40:25,740 --> 00:40:26,160
bytes.

616
00:40:26,160 --> 00:40:35,370
Maybe read ahead from the underlying string than are necessary to satisfy the current thread operation

617
00:40:35,880 --> 00:40:37,500
for top efficiency.

618
00:40:37,500 --> 00:40:42,660
Consider wrapping an input stream reader within a buffer the reader as you can see here.

619
00:40:42,780 --> 00:40:50,120
So that's what what we actually done in our code buffer the reader input reader as you can see new Bufford

620
00:40:50,160 --> 00:40:53,530
reader new input stream reader system that in.

621
00:40:53,580 --> 00:40:58,480
So as you can see here in the Android studio you have a buffer entry that object.

622
00:40:58,530 --> 00:41:05,220
And here I created a buffer object and here inside the prentices I created an input stream reader object

623
00:41:05,250 --> 00:41:08,480
OK in order to read those characters.

624
00:41:08,490 --> 00:41:13,830
And here I actually pass this file inputs to an object that I created.

625
00:41:13,830 --> 00:41:23,030
Here are Trudy's constructor of this input stream reader class and here I created a variable of type

626
00:41:23,030 --> 00:41:27,940
strain file data and then I assigned an empty value to this variable.

627
00:41:28,080 --> 00:41:32,000
And here I created another variable called buffer data.

628
00:41:32,280 --> 00:41:35,540
And then again I assigned an empty value to this variable.

629
00:41:35,640 --> 00:41:42,470
And here I created a while loop so void first is going to actually execute this expression here.

630
00:41:42,540 --> 00:41:47,440
White flight data as you can see is going to actually assign buffer the reader that read the line.

631
00:41:47,580 --> 00:41:50,120
OK is going to try to read those data.

632
00:41:50,250 --> 00:41:52,000
One line line line.

633
00:41:52,160 --> 00:41:54,210
And that is going to assign those are they to this.

634
00:41:54,210 --> 00:42:00,320
Why data are key and then is going to check whether those file data is not equal to null.

635
00:42:00,590 --> 00:42:04,090
OK and then is can actually execute this line of code here.

636
00:42:04,100 --> 00:42:09,280
Buffer date of assignment operator buffered data plus file data.

637
00:42:09,530 --> 00:42:17,090
OK so he's going to actually assign these values to these for buffered data and then here I created

638
00:42:17,120 --> 00:42:19,530
a newline character after each line.

639
00:42:19,610 --> 00:42:23,350
OK so it's going to reduce the top line by line and then here.

640
00:42:23,360 --> 00:42:29,340
I just wanted to put a newline character to read those lines of one but one line by line and that is

641
00:42:29,340 --> 00:42:31,810
going to put a newline character after each line.

642
00:42:31,850 --> 00:42:40,120
OK so now here as you can see I have this de-valued that said text buffered data.

643
00:42:40,250 --> 00:42:43,860
So here I just want to assign this value buffer later to the sticks the value.

644
00:42:44,210 --> 00:42:50,920
And then here I need to actually close this buffered leader here.

645
00:42:50,970 --> 00:42:52,180
Discovery that object.

646
00:42:52,250 --> 00:42:56,480
So I just referred to this object Bonfils reader that close.

647
00:42:56,480 --> 00:43:02,750
So this is I'm afraid this is an instance of it that the OP could actually call on this object.

648
00:43:02,790 --> 00:43:09,110
OK and here we have this catch exception here and here is connected if any error occurs while reading

649
00:43:09,110 --> 00:43:12,440
the data from the SD card that is in.

650
00:43:12,670 --> 00:43:20,000
That actually contains this nice file that you XTi then this block of code is going to be executed and

651
00:43:20,000 --> 00:43:25,730
then add a description of the error is going to be actually shown ended up in the Lugg.

652
00:43:25,940 --> 00:43:29,480
And here this toast message is going to be shown to the user.

653
00:43:29,470 --> 00:43:30,720
Exception occurred.

654
00:43:30,740 --> 00:43:31,550
Check log.

655
00:43:31,580 --> 00:43:32,540
For more info.

656
00:43:32,600 --> 00:43:34,150
So hopefully that makes sense.

657
00:43:34,230 --> 00:43:37,120
And now let's actually go back in.

658
00:43:37,190 --> 00:43:39,660
Unclear if it here and here at the end.

659
00:43:39,680 --> 00:43:42,350
Let's actually create another case statement.

660
00:43:42,350 --> 00:43:48,180
So case are that the DOT PTEN save file.

661
00:43:48,260 --> 00:43:56,030
Ok BT and say find colon break and then here I can just call that method.

662
00:43:56,060 --> 00:44:00,770
For example let's save file two documents folder.

663
00:44:00,770 --> 00:44:02,830
I have this method and I have this.

664
00:44:02,900 --> 00:44:06,700
Let's retrieve retrieve file data from documents folder.

665
00:44:06,740 --> 00:44:12,350
So here I just need to call the Smurfit And as you can see here it's now showing us an error.

666
00:44:12,620 --> 00:44:19,400
OK so let's actually hovered over the error area and see what's the error duplicate label.

667
00:44:19,430 --> 00:44:22,290
So here we have our duplicate label.

668
00:44:22,310 --> 00:44:26,800
I mistakenly I refered to this BT and say file here.

669
00:44:26,810 --> 00:44:29,180
I just need to refer to the the name of the between.

670
00:44:29,180 --> 00:44:31,080
Retrieve the info.

671
00:44:31,220 --> 00:44:32,850
OK we have this button.

672
00:44:32,930 --> 00:44:35,450
So let's actually go back to our emulator here.

673
00:44:35,480 --> 00:44:37,960
As you can see retrieve the information from SD card.

674
00:44:37,950 --> 00:44:44,170
So I just needed to refer to the Spartan in OK instead of referring to this button.

675
00:44:44,210 --> 00:44:50,510
So here case are that ID that BT and retrieve the info are that ID data between retrieve the info.

676
00:44:50,780 --> 00:44:52,620
And here we have this method.

677
00:44:52,640 --> 00:44:56,370
Let's retrieve file data from Documents folder break.

678
00:44:56,720 --> 00:44:59,930
So now let's actually run our project and see what happens.

679
00:44:59,930 --> 00:45:04,010
So now as you can see our application is running on this emulator.

680
00:45:04,100 --> 00:45:08,980
So now you want to actually click on this button retrieve the information from SD card.

681
00:45:09,170 --> 00:45:17,510
So now as you can see I actually now see the value that was inside of the TXI the file that that I actually

682
00:45:17,510 --> 00:45:20,440
saved inside my for SD card.

683
00:45:20,450 --> 00:45:29,150
So here I just want to assign another value for example my name OK and then I just disappear this keyboard

684
00:45:29,390 --> 00:45:35,260
and here I just want to click on the spot and save it to documents folder saved and then now I'm on

685
00:45:35,280 --> 00:45:36,840
to click on this button.

686
00:45:36,950 --> 00:45:41,180
Now I can see this value or I can actually type in another value.

687
00:45:41,180 --> 00:45:42,000
Nice.

688
00:45:42,290 --> 00:45:43,610
OK.

689
00:45:43,640 --> 00:45:49,790
And then here I just need to click on the spot and save it to documents folder in SD card and now it's

690
00:45:49,930 --> 00:45:50,880
saved.

691
00:45:51,020 --> 00:45:54,030
And now if I click on the spot in it says Nice.

692
00:45:54,070 --> 00:45:58,400
OK so this is how we can actually read data from the SD card.

693
00:45:58,760 --> 00:46:01,460
And this is how we can actually save data to SD card.

694
00:46:01,510 --> 00:46:04,640
OK so hopefully that makes sense.

695
00:46:04,640 --> 00:46:08,270
And now let's actually add some other functionalities to this application.

696
00:46:08,270 --> 00:46:11,280
Here I just want to add another functionality.

697
00:46:11,360 --> 00:46:17,990
So when the user clicks on this image as you can see here I want to actually save this image in the

698
00:46:17,990 --> 00:46:18,850
SD card.

699
00:46:18,990 --> 00:46:24,680
OK so let's actually go back to our main activity that have a file here and again we need to add another

700
00:46:24,680 --> 00:46:27,540
method for saving an image to SD card.

701
00:46:27,600 --> 00:46:35,060
OK so now in order to save the image in SD card and then see that image in our Android device monitor

702
00:46:35,210 --> 00:46:39,590
here I just want to create another method to do that job for me.

703
00:46:39,800 --> 00:46:44,050
So here I'm going to paste in an effort and then I'm going to explain to you what's going on here.

704
00:46:44,120 --> 00:46:48,740
So as you can see here this is the method that I actually paste that here and as you can see the access

705
00:46:48,740 --> 00:46:50,830
modifier of this method is public.

706
00:46:50,830 --> 00:46:56,700
There is anti-poverty Smurfette is void the name of this method is let's save the image to pictures

707
00:46:56,700 --> 00:46:58,210
folder as you can see.

708
00:46:58,380 --> 00:47:04,750
And now as you can see I created a straightedge exception and here inside a truck try Blatch.

709
00:47:04,890 --> 00:47:06,810
I have a bitmap object.

710
00:47:06,810 --> 00:47:13,380
OK bitmap bitmap bitmap factory that decode rissoles first double for the first argument.

711
00:47:13,510 --> 00:47:16,740
We need to refer to the resources of our application.

712
00:47:16,770 --> 00:47:18,070
So it gives resources.

713
00:47:18,090 --> 00:47:25,000
And the second argument is the name of the image that is inside of the triable folder of our application.

714
00:47:25,140 --> 00:47:28,070
So here I have our triable dot tiger.

715
00:47:28,230 --> 00:47:28,710
OK.

716
00:47:28,860 --> 00:47:34,020
So this image is inside the tribal folder of our project structure.

717
00:47:34,170 --> 00:47:37,830
And here I have an object of type fight.

718
00:47:37,920 --> 00:47:38,560
OK.

719
00:47:39,000 --> 00:47:41,140
So the name of this object is flightpath.

720
00:47:41,400 --> 00:47:44,820
And as you can see the data type of this object is filed.

721
00:47:44,820 --> 00:47:46,650
Assignment operator new.

722
00:47:46,650 --> 00:47:49,760
So here I want to create an object of type file.

723
00:47:49,850 --> 00:47:50,390
OK.

724
00:47:50,580 --> 00:47:51,580
New File.

725
00:47:51,840 --> 00:47:58,020
And for the first argument as you can see here I just want to specify the directory that I want to actually

726
00:47:58,020 --> 00:47:59,250
save the image.

727
00:47:59,250 --> 00:48:03,420
So it environment that gets external storage public directory.

728
00:48:03,540 --> 00:48:06,240
So here it's going to actually give me the access to SD card.

729
00:48:06,510 --> 00:48:13,060
And here inside Apprentice's I need to specify the specific folder specific directory in my SD card

730
00:48:13,170 --> 00:48:15,440
so environment that directory pictures.

731
00:48:15,600 --> 00:48:20,460
So here I want to actually save my image to direct to the pictures.

732
00:48:20,460 --> 00:48:20,910
OK.

733
00:48:20,990 --> 00:48:21,750
Come on.

734
00:48:21,870 --> 00:48:28,390
And here I need to actually specify that the name of the image that you want to actually save.

735
00:48:28,410 --> 00:48:34,420
So here I need to specify the name of that image of this tiger image that you want to say inside that

736
00:48:34,440 --> 00:48:36,990
directory pictures of my SD card.

737
00:48:37,020 --> 00:48:43,920
As you can see Tiger underly image that PMG or I could actually change it to another name for example

738
00:48:43,950 --> 00:48:46,640
Tiger want to free that P and G.

739
00:48:46,670 --> 00:48:53,960
Ok here I specify the name and then it's very important that you actually put the piano here to in order

740
00:48:53,960 --> 00:48:55,530
to specify the format.

741
00:48:55,850 --> 00:49:03,250
And here I created an object of type output stream output stream new file output stream flightpath.

742
00:49:03,480 --> 00:49:08,080
OK so here as you can see let's actually go back to our Android documentation.

743
00:49:08,090 --> 00:49:11,960
In order to see what is this output stream object.

744
00:49:11,960 --> 00:49:19,300
So here I just need to search for output string OK I have this output stream here.

745
00:49:19,640 --> 00:49:20,670
So I just click on it.

746
00:49:20,690 --> 00:49:24,940
And as you can see here public abstract class output stream.

747
00:49:25,050 --> 00:49:26,940
So as you can see this class is abstract.

748
00:49:26,990 --> 00:49:34,780
So if we cannot create an object of a type as it can see of type abstract K.B. cannot create directly

749
00:49:34,780 --> 00:49:36,740
an object from this class.

750
00:49:36,800 --> 00:49:43,760
And as you can see here here it says this abstract class is the superclass of all classes representing

751
00:49:43,850 --> 00:49:51,870
an output stream of bytes an output stream accepts output bytes and send them to some scene.

752
00:49:51,920 --> 00:49:52,320
OK.

753
00:49:52,340 --> 00:49:58,820
Applications that need to define a subclass of output stream must always provide at least a method that

754
00:49:58,820 --> 00:50:00,790
writes one byte of output.

755
00:50:00,890 --> 00:50:04,160
OK so let's go back to our Android studio here.

756
00:50:04,440 --> 00:50:10,290
Here as you can see I created an object here of type output stream as you can see.

757
00:50:10,400 --> 00:50:12,340
So remember this class is an abstract class.

758
00:50:12,380 --> 00:50:16,490
So here we need to actually refer to this flight output stream object.

759
00:50:16,490 --> 00:50:16,730
OK.

760
00:50:16,760 --> 00:50:19,100
Which is actually a subclass of output stream.

761
00:50:19,100 --> 00:50:25,590
So let's go back to what Andrew documentation and says For find out food stream.

762
00:50:25,820 --> 00:50:29,920
As you can see here I have this class here.

763
00:50:30,040 --> 00:50:36,650
And as you can see file output stream actually directly inherits from this output stream class.

764
00:50:36,700 --> 00:50:42,700
So here because this class is an abstract class and we cannot create an object of type with stream directly

765
00:50:43,050 --> 00:50:46,440
here I created an object of type flight output stream.

766
00:50:46,630 --> 00:50:52,150
And then I pass this final path to this class constructor flightpath.

767
00:50:52,150 --> 00:50:52,940
OK.

768
00:50:53,320 --> 00:50:57,460
And then here if there is a bitmap object that compress.

769
00:50:57,520 --> 00:51:01,830
So remember we have a method called compress for bitmap objects.

770
00:51:01,990 --> 00:51:07,230
First of all we need to specify our format of our image that we want to save.

771
00:51:07,240 --> 00:51:09,880
Bitmap does compress formats that P and G.

772
00:51:09,880 --> 00:51:13,150
Here we want to actually compress our image and save it.

773
00:51:13,260 --> 00:51:14,130
Yes the cart.

774
00:51:14,140 --> 00:51:15,510
So we need to call this method.

775
00:51:15,670 --> 00:51:17,760
So the format of our image is PNB.

776
00:51:17,890 --> 00:51:24,940
OK we could actually use other methods for example JPT or Tepic or other formats.

777
00:51:24,940 --> 00:51:26,640
I choose and G.

778
00:51:26,950 --> 00:51:29,640
And here we need to specify the quality of our image.

779
00:51:29,650 --> 00:51:31,320
So 100 is good.

780
00:51:31,660 --> 00:51:37,510
And here we need to pass the output stream object output stream in order to save that image to file

781
00:51:37,510 --> 00:51:37,800
path.

782
00:51:37,810 --> 00:51:38,580
OK.

783
00:51:39,070 --> 00:51:44,300
And then we need to call this my method output stream that flash and out of the stream that close.

784
00:51:44,490 --> 00:51:44,780
OK.

785
00:51:44,790 --> 00:51:47,950
And then here we need to show our message to the user.

786
00:51:48,010 --> 00:51:53,760
Your image has been successfully saved so let's actually go back to what Android documentation here.

787
00:51:53,770 --> 00:51:58,020
In order to search for Flash Smurfette flush.

788
00:51:58,520 --> 00:52:04,630
And here we can actually see that Meffert if you search for it let's actually go back to what our output

789
00:52:04,630 --> 00:52:14,280
stream class in order to see the methods that are actually related to output stream.

790
00:52:14,290 --> 00:52:21,130
So here as you can see we have the psalmody flush as you can see this Meffert flushes this output stream

791
00:52:21,370 --> 00:52:25,290
and forces any buffered output bytes to be written out.

792
00:52:25,360 --> 00:52:25,980
OK.

793
00:52:26,080 --> 00:52:32,080
And we have a close MF'er closes this output stream and really says any system resources associated

794
00:52:32,470 --> 00:52:33,510
with this stream.

795
00:52:33,730 --> 00:52:40,210
OK so we needed to actually call this flush in order to actually it says that it flushes this output

796
00:52:40,210 --> 00:52:45,570
stream and forces any buffered output bytes to be written out.

797
00:52:45,610 --> 00:52:46,280
OK.

798
00:52:46,750 --> 00:52:53,230
And here as you can see I just wanted to show a message to the user and we have a catch block here.

799
00:52:53,380 --> 00:53:01,900
So if the program actually runs into error and if the program cannot actually save this image into SD

800
00:53:01,900 --> 00:53:10,560
card into the collector the pictures then an error may occur and we can actually catch that error inside

801
00:53:10,570 --> 00:53:11,130
this block.

802
00:53:11,140 --> 00:53:17,900
And this is going to show me a description of that error and then put that error inside the lock.

803
00:53:18,070 --> 00:53:22,760
And then it's going to show us and a tossed object exception occurred.

804
00:53:22,840 --> 00:53:24,660
Check look for more info.

805
00:53:24,970 --> 00:53:26,260
So let's actually go back to.

806
00:53:26,450 --> 00:53:32,370
Inside these enclaves Mefford And here let's actually create another case statement here.

807
00:53:32,410 --> 00:53:38,290
So case our thoughts ID dot BT G.

808
00:53:38,420 --> 00:53:44,290
And so if the user clicks on that image ok for example this image as you can see here we have this image.

809
00:53:44,410 --> 00:53:50,980
If the user clicks on this image then and when I do something break here and then here I just need to

810
00:53:51,310 --> 00:53:56,590
call that and if it lets us save the image to pictures folder OK.

811
00:53:56,740 --> 00:53:59,740
So let's actually run our project here and see what happens.

812
00:53:59,740 --> 00:54:04,620
So as you can see here now our application is actually running on this emulator.

813
00:54:04,660 --> 00:54:10,750
Let me actually make this keyboard disappear and now I want to actually click on this image here.

814
00:54:10,780 --> 00:54:11,050
OK.

815
00:54:11,050 --> 00:54:13,950
In order to save this image in the SD card.

816
00:54:14,140 --> 00:54:19,130
So let's actually click on it and now it says your image has been successfully saved.

817
00:54:19,180 --> 00:54:23,220
So let's actually open our Android device monitor as you can see here.

818
00:54:23,230 --> 00:54:29,610
This is my Android device monitor inside these stories folder inside this emulated zero here.

819
00:54:29,620 --> 00:54:32,220
As you can see I have these directories.

820
00:54:32,260 --> 00:54:36,640
So let's actually search for the pictures directory as you can see here.

821
00:54:36,730 --> 00:54:38,620
And inside these pictures directory.

822
00:54:38,620 --> 00:54:42,020
I have this image Tiger I want to free that PMG.

823
00:54:42,070 --> 00:54:46,750
So we managed to successfully save an image into SD card.

824
00:54:47,110 --> 00:54:48,930
So hopefully that makes sense.

825
00:54:48,940 --> 00:54:54,000
So let's actually go back to our Android studio and here I want to actually add some more functionalities

826
00:54:54,400 --> 00:54:56,490
to our application here.

827
00:54:56,500 --> 00:55:02,830
I just want to allow the user to actually click on the spot and allow access pictures in SD card.

828
00:55:02,860 --> 00:55:06,280
So I want to actually add some pictures to my 3D SD card.

829
00:55:06,280 --> 00:55:16,900
And then by just clicking on this button I want to let the user to see the images that we actually retrieve

830
00:55:16,900 --> 00:55:25,240
from the SD card and put it inside on our inside the image switcher and sure the use user those images.

831
00:55:25,240 --> 00:55:30,550
So in order to do that job we need to create another team effort let's actually scroll to the top of

832
00:55:30,580 --> 00:55:37,570
our Java file here and here I want to actually declare two variables here.

833
00:55:37,630 --> 00:55:42,980
So here I want to create an add a list of strange values.

834
00:55:43,090 --> 00:55:46,060
So I just need to type in a list here.

835
00:55:46,390 --> 00:55:52,510
And inside these angle brackets I need to specify the type of objects that I want to assign to this

836
00:55:52,510 --> 00:55:53,010
area.

837
00:55:53,050 --> 00:55:53,680
OK.

838
00:55:53,680 --> 00:56:00,820
So at least as strange and the name of this array is going to be file path names.

839
00:56:01,180 --> 00:56:04,680
OK so this is this array is going to hold.

840
00:56:05,080 --> 00:56:07,830
Actually the names of the file paths OK.

841
00:56:08,200 --> 00:56:11,880
And here I want to create another array of type find.

842
00:56:12,110 --> 00:56:14,310
OK so find files.

843
00:56:14,380 --> 00:56:17,570
So I just need to put a semicolon at the end of my statement.

844
00:56:17,680 --> 00:56:20,880
So here I actually declared two objects.

845
00:56:20,920 --> 00:56:25,540
OK the first one is an array list object of types three file pathnames.

846
00:56:25,540 --> 00:56:29,120
And the second one is an array of file objects.

847
00:56:29,140 --> 00:56:29,730
OK.

848
00:56:29,920 --> 00:56:33,470
So let's actually go back inside this on create Smurfette.

849
00:56:33,670 --> 00:56:41,500
And now I want to actually be fair to the name of this button BT and allow access Beecher's pattern

850
00:56:41,740 --> 00:56:42,390
here.

851
00:56:42,700 --> 00:56:47,870
So here I just need to type in PTEN allow access pictures.

852
00:56:47,900 --> 00:56:51,310
That's set unclick listener.

853
00:56:51,520 --> 00:56:54,570
So here I want to use an anonymous inner class.

854
00:56:54,780 --> 00:56:55,240
OK.

855
00:56:55,480 --> 00:57:01,010
So we allow access pictures that certainly isn't a new view.

856
00:57:01,180 --> 00:57:03,640
So here as you can see I just need to choose this option.

857
00:57:03,640 --> 00:57:04,670
Unclick listener.

858
00:57:04,810 --> 00:57:10,060
And then it's going to create an anonymous class for me and that anonymous class is going to actually

859
00:57:10,360 --> 00:57:16,810
implement this view that an uncle listener interface and then it's going to override this uncle uncle

860
00:57:16,900 --> 00:57:17,760
my first for me.

861
00:57:17,800 --> 00:57:21,530
OK so now I am inside an anonymous inner class.

862
00:57:21,760 --> 00:57:22,120
OK.

863
00:57:22,120 --> 00:57:27,470
And here inside that class inside that anonymous class I have this unclick method.

864
00:57:27,610 --> 00:57:29,670
So now I can put my Ancoats here.

