1
00:00:00,240 --> 00:00:03,800
So as you can see here this is the effort that I actually pasted here.

2
00:00:03,810 --> 00:00:07,160
These are the lines of code that I actually pasted here.

3
00:00:07,470 --> 00:00:11,480
And as you can see the Axis modifier of the Smurfit is public.

4
00:00:11,490 --> 00:00:18,720
The return type of this method is actually map and the name of this method is get beat map from you

5
00:00:18,720 --> 00:00:19,290
r l.

6
00:00:19,350 --> 00:00:24,230
OK so if you want to we want to actually get an image from the u r l that we passed to this method.

7
00:00:24,240 --> 00:00:24,690
OK.

8
00:00:24,960 --> 00:00:28,140
And the type of that image is going to be bitmap.

9
00:00:28,140 --> 00:00:29,430
This is very important.

10
00:00:29,490 --> 00:00:34,410
So as you can see here this if it actually accepts an argument of type strange and the name of this

11
00:00:34,410 --> 00:00:38,370
argument is strange u r l and inside the Smurfette.

12
00:00:38,370 --> 00:00:40,020
So now we are inside of this Meffert.

13
00:00:40,020 --> 00:00:40,520
OK.

14
00:00:40,680 --> 00:00:48,510
So in line 74 I created an object of type bitmap and that as you can see the name of this object is

15
00:00:48,510 --> 00:00:49,570
bitmap.

16
00:00:49,680 --> 00:00:53,250
And then I assign the value null to this object.

17
00:00:53,550 --> 00:00:56,540
And as you can see here we have this try catch block here.

18
00:00:56,550 --> 00:01:02,070
So inside the try block as you can see I have these lines of code in order to actually download the

19
00:01:02,070 --> 00:01:05,810
image from the internet and assign that image to this bitmap object.

20
00:01:05,820 --> 00:01:13,650
So here a line 74 77 I created an object of type u r l and the name of this object is you are an assignment

21
00:01:13,680 --> 00:01:17,640
operator new u r l and the past is of value.

22
00:01:17,640 --> 00:01:25,120
This string value as an argument to the constructor as you can see here to this class string you are

23
00:01:25,120 --> 00:01:25,490
ill.

24
00:01:25,680 --> 00:01:28,670
And we are actually assigning that value to this object.

25
00:01:28,860 --> 00:01:29,320
OK.

26
00:01:29,520 --> 00:01:31,550
So now we have that u r l here.

27
00:01:31,920 --> 00:01:38,010
And in light 78 as you can see here I created an object of the input stream and the name of this object

28
00:01:38,010 --> 00:01:39,050
is input stream.

29
00:01:39,150 --> 00:01:40,330
Assignment operator.

30
00:01:40,470 --> 00:01:44,530
So here I referred to the name of this you are an object that open stream.

31
00:01:44,550 --> 00:01:49,830
So here it is very important that you call this method open stream in order because you want to download

32
00:01:50,280 --> 00:01:51,620
the image from this model.

33
00:01:51,630 --> 00:01:55,570
Here we need to call this method open stream on this object you are in.

34
00:01:55,590 --> 00:01:56,090
OK.

35
00:01:56,190 --> 00:01:59,240
And then we are assigning that value to the input stream object.

36
00:01:59,250 --> 00:02:05,550
So now we initialized this input stream object and line 79 as you can see.

37
00:02:05,550 --> 00:02:12,380
Now I want to initialize this bitmap object so bitmap assignment operator bitmap factory that D-CT stream.

38
00:02:12,510 --> 00:02:18,000
So this is actually a static method inside this bitmap vector the class in order to decode in order

39
00:02:18,000 --> 00:02:20,430
to decode the stream input stream.

40
00:02:20,580 --> 00:02:24,840
OK so this is how we actually download the image from the Internet and we assign that to the bitmap

41
00:02:24,900 --> 00:02:25,480
object.

42
00:02:25,530 --> 00:02:31,110
So as you can see here I initialize this bitmap object he had and as scientist value to this bitmap

43
00:02:31,140 --> 00:02:31,590
object.

44
00:02:31,590 --> 00:02:32,260
OK.

45
00:02:32,670 --> 00:02:34,860
And then we have this catch block here.

46
00:02:34,860 --> 00:02:40,800
So in case we cannot actually download the image from the Internet or the internet connection is actually

47
00:02:41,460 --> 00:02:47,190
there is no internet connection and it's going to actually catch those errors and it's going to output

48
00:02:47,280 --> 00:02:50,690
those letters to the lug that pre-date stack trace.

49
00:02:51,150 --> 00:02:53,890
And here we have this written bitmap.

50
00:02:54,000 --> 00:02:54,760
OK.

51
00:02:55,060 --> 00:02:58,610
We could actually put this written bitmap inside this tripe like.

52
00:02:58,810 --> 00:02:59,470
OK.

53
00:02:59,700 --> 00:03:06,690
But we can actually put it outside of this trope like it doesn't really matter.

54
00:03:06,720 --> 00:03:07,290
OK.

55
00:03:07,580 --> 00:03:11,830
So I mean it is enough for this class.

56
00:03:12,060 --> 00:03:18,570
And now let's actually go inside our main activity of a fight here and then let's actually declare some

57
00:03:18,630 --> 00:03:24,090
user interface components here as you can see so inside our activity underline minute exam and as you

58
00:03:24,090 --> 00:03:28,840
can see here we have type artist name collection name rank name and kind.

59
00:03:29,010 --> 00:03:29,550
OK.

60
00:03:29,550 --> 00:03:33,660
So let's actually put those objects here inside that main activity class.

61
00:03:33,660 --> 00:03:38,970
So now I'm going to paste in some lines of code here and then I'm going to explain to you what's going

62
00:03:38,970 --> 00:03:39,740
on here.

63
00:03:39,780 --> 00:03:46,280
So here as you can see I declared these objects and these are the lines of code that I actually put

64
00:03:46,510 --> 00:03:48,110
put inside the main activity class.

65
00:03:48,120 --> 00:03:54,870
So the first object is takes UTX the artist name takes to type as you can see here takes the kind takes

66
00:03:54,870 --> 00:03:58,250
the collection name DHT track name as you can see here.

67
00:03:58,560 --> 00:03:59,560
I m g art.

68
00:03:59,580 --> 00:04:01,650
So let's go back to our right to beauty and alignment.

69
00:04:01,680 --> 00:04:07,020
I mean that is I mean that's actually double click on this image here for the ID just type it just as

70
00:04:07,110 --> 00:04:07,800
assigned a value.

71
00:04:07,850 --> 00:04:12,600
AMG art and then present Enter key on your keyboard.

72
00:04:12,930 --> 00:04:15,920
So let's go back to our main activity class as you can see here.

73
00:04:16,290 --> 00:04:20,860
And here I have this variable strange IMJ RL.

74
00:04:21,270 --> 00:04:29,760
OK I will put reduce this value later and in line 21 as you can see I declared an object of type button.

75
00:04:29,780 --> 00:04:33,260
So the name of this button is bitti and retrieve info.

76
00:04:33,510 --> 00:04:37,190
So let's go back to an activity underline that it may not examine as you can see here.

77
00:04:37,290 --> 00:04:42,850
Let's double click on the spot in here as you can see the idea of the spot it is BT and get data.

78
00:04:43,020 --> 00:04:49,930
So I can change the name the name of this button that I declared in my main activity class to PTEN get

79
00:04:49,940 --> 00:04:53,890
the data PTEN get data.

80
00:04:54,300 --> 00:04:58,220
And in line 22 I declared another takes.

81
00:04:58,350 --> 00:05:02,380
So we don't need this object here.

82
00:05:02,510 --> 00:05:07,970
And as you can see here we have actually declared this object of type bitmap.

83
00:05:08,000 --> 00:05:14,810
OK so now let's actually initialize these objects that we actually declared inside our main activity

84
00:05:14,810 --> 00:05:15,410
class.

85
00:05:15,590 --> 00:05:17,790
So the first object is going to be the artist name.

86
00:05:17,810 --> 00:05:21,630
OK so the artist name assignment operator.

87
00:05:21,770 --> 00:05:31,540
So now let's cast this object to a text view object find view by ID or that Id dot asks the artist name.

88
00:05:31,880 --> 00:05:34,730
So now let's actually put a semicolon at the end of our statement.

89
00:05:34,970 --> 00:05:41,680
So then the next object that we want to instantiate here inside uncreate if it is going to be the type.

90
00:05:41,810 --> 00:05:48,860
So it takes the type that assignment operator is BTC type assignment operator.

91
00:05:48,860 --> 00:05:59,010
So now let's test this object to a taste object find view by id artist Id dot X the type and then let's

92
00:05:59,010 --> 00:06:01,400
actually put a semicolon at the end of our statement.

93
00:06:01,600 --> 00:06:05,100
And now let's actually initialize this takes the kind.

94
00:06:05,100 --> 00:06:09,920
So I just need to refer to the name of this object the kind assignment operator.

95
00:06:09,920 --> 00:06:18,210
So now let's cast this object to a taste view object find view by id artist Id that takes the kind.

96
00:06:18,410 --> 00:06:19,430
As you can see here.

97
00:06:19,440 --> 00:06:24,900
So let's actually put a semicolon at the end of her statement and then let's actually initialize this

98
00:06:25,080 --> 00:06:26,440
takes the collection name.

99
00:06:26,600 --> 00:06:32,140
So takes the th the collection name assignment operator.

100
00:06:32,160 --> 00:06:39,750
So now let's cast this object to it takes a view object find view by id art that ID that takes the collection

101
00:06:39,750 --> 00:06:45,160
name and then lets actually put a semi-colon at the end of our statement here.

102
00:06:45,630 --> 00:06:49,530
And then let's actually instantiate this takes the Tracht name.

103
00:06:49,530 --> 00:06:54,070
So th the throuch name assignment operator.

104
00:06:54,090 --> 00:07:03,810
So now this has recast this object to a Takes view object find view by id r that ID that takes the training

105
00:07:04,860 --> 00:07:08,540
and then they actually put a semicolon at the end of our statement.

106
00:07:09,620 --> 00:07:14,400
And then let's actually initialize this image view here IMT art.

107
00:07:14,450 --> 00:07:17,180
So I just need to revert to the name of this object.

108
00:07:17,190 --> 00:07:19,670
I m g art assignment operator.

109
00:07:19,970 --> 00:07:30,370
And then let's actually test this object to a image object find view by id r that ID that m g r.

110
00:07:30,770 --> 00:07:34,100
And then let's actually put a semicolon at the end of our statement.

111
00:07:34,130 --> 00:07:38,130
So then let's actually initialize this beauty and get data object.

112
00:07:38,150 --> 00:07:45,560
So PTEN get the assignment operator and then essentially cast this object to a button object find view

113
00:07:45,560 --> 00:07:49,990
by ID or that ID that PTEN get data.

114
00:07:50,330 --> 00:07:53,510
And then let's actually put a semicolon at the end of our statement.

115
00:07:54,060 --> 00:07:57,280
And now inside our main activity class.

116
00:07:57,350 --> 00:08:03,530
So after the end in brace of this uncreate method inside our main activity class we need to actually

117
00:08:03,530 --> 00:08:08,550
create an inner class to do the job to do the asynchronous jobs.

118
00:08:08,570 --> 00:08:08,980
OK.

119
00:08:09,020 --> 00:08:13,650
Because we don't want to actually block the user interface Fred.

120
00:08:13,700 --> 00:08:16,980
OK we don't want to plug the main thread of our application.

121
00:08:17,090 --> 00:08:24,560
We want to actually put the job of downloading that stuff or that image from the internet in the background

122
00:08:24,560 --> 00:08:25,220
for it Fred.

123
00:08:25,250 --> 00:08:25,810
OK.

124
00:08:25,940 --> 00:08:31,430
We don't want to actually block or actually put heavy jobs on the main flight.

125
00:08:31,460 --> 00:08:32,350
It's very bad.

126
00:08:32,450 --> 00:08:33,020
OK.

127
00:08:33,110 --> 00:08:39,620
We need to actually do their job of downloading the stuff or downloading the image from Twitter from

128
00:08:39,620 --> 00:08:41,690
the internet in the background for it.

129
00:08:41,690 --> 00:08:47,780
So in order to do that we need to actually create an entire class in order to do that job for us.

130
00:08:47,780 --> 00:08:52,820
So inside the main activity class I'm going to actually pay that class here and then I'm going to explain

131
00:08:52,820 --> 00:08:55,520
to you what's going on here.

132
00:08:55,550 --> 00:09:01,520
So as you can see here I pasted this class here inside our main activity class and now I'm going to

133
00:09:01,640 --> 00:09:03,770
explain to you what's going on here.

134
00:09:03,830 --> 00:09:08,780
So this is the class OK these are the lines of code that I actually pasted here and now I'm going I

135
00:09:08,780 --> 00:09:12,970
try to explain to you what is this class and what does this class do.

136
00:09:12,980 --> 00:09:20,420
So in 947 as you can see here the axis modifier of this class is private and it is actually a class

137
00:09:20,510 --> 00:09:21,190
as you can see.

138
00:09:21,230 --> 00:09:25,370
And as you can see here the name of our class is Jason right.

139
00:09:25,380 --> 00:09:26,980
Hume's stuff Pasch.

140
00:09:27,140 --> 00:09:33,690
OK this is the task of actually downloading this stuff and the image from the Internet.

141
00:09:33,710 --> 00:09:36,150
So if you need to put this task in the background for it.

142
00:09:36,320 --> 00:09:38,630
So it is going to be an asynchronous task.

143
00:09:38,630 --> 00:09:39,050
OK.

144
00:09:39,260 --> 00:09:42,060
So this class extends from this async task.

145
00:09:42,290 --> 00:09:45,410
And as you can see here we need to pass three arguments to this class.

146
00:09:45,470 --> 00:09:47,430
The first one is going to be the input.

147
00:09:47,510 --> 00:09:50,910
So remember that we want to actually get the data from an u r l.

148
00:09:50,920 --> 00:09:59,040
OK we actually assign a u r l and then B we actually get the data from the Internet to some stuff.

149
00:09:59,070 --> 00:10:02,510
The RL is going to be of types three past that you are.

150
00:10:02,540 --> 00:10:04,880
Which is strange here.

151
00:10:05,630 --> 00:10:11,720
And this void here the second argument is going to actual return to us the units of progress if you

152
00:10:11,720 --> 00:10:15,930
want to actually know how much of the contents is actually maynt.

153
00:10:16,250 --> 00:10:19,850
And we can actually get those data here as well as the second argument.

154
00:10:19,850 --> 00:10:24,240
So here for our specific application we get we don't want to get those data.

155
00:10:24,470 --> 00:10:30,230
So we pass the value voyde with Capitol V and for the first argument this is going to be the output

156
00:10:30,710 --> 00:10:34,260
the output that is going to be returned from this class.

157
00:10:34,310 --> 00:10:40,200
We want to get the items stuff we want to get the data that is inside the iTunes service and we want

158
00:10:40,210 --> 00:10:42,150
to put those data into our application.

159
00:10:42,260 --> 00:10:42,860
OK.

160
00:10:42,860 --> 00:10:45,350
So the past that you are ill which is off the street.

161
00:10:45,500 --> 00:10:53,000
And if you get those data that is actually of type items stuff the information that is inside of the

162
00:10:53,000 --> 00:10:54,190
items we have service.

163
00:10:54,350 --> 00:11:01,250
So this is going to be the output this is input this is output remember and here as you can see inside

164
00:11:01,250 --> 00:11:05,730
this class like actually declared an object of type context.

165
00:11:05,780 --> 00:11:09,130
As you can see here and the name of this object is context.

166
00:11:09,230 --> 00:11:14,600
And here again I actually declared an object of type Procrustes dialogue in order to show to the user

167
00:11:14,810 --> 00:11:17,710
that something is actually downloading from the Internet.

168
00:11:17,720 --> 00:11:20,160
So I need to actually declare this object here.

169
00:11:20,570 --> 00:11:28,740
And then I created a constructor for this class so public Dayton's Jason iTunes stuff Pasch.

170
00:11:28,910 --> 00:11:33,930
So remember the name of the constructor must be the same as the name of the class Dasen items stuff

171
00:11:33,950 --> 00:11:34,540
ask.

172
00:11:34,610 --> 00:11:39,360
And this class this is constructed actually to access an argument of type context.

173
00:11:39,380 --> 00:11:46,130
So as you can see here the name of this argument is context as you can see here at inside the constructor

174
00:11:46,130 --> 00:11:46,770
here.

175
00:11:46,850 --> 00:11:53,720
I am actually initializing this context object so does that context assignment operator context.

176
00:11:53,720 --> 00:12:00,630
So here I am actually passing this context that I actually receive as an argument from the constructor.

177
00:12:00,690 --> 00:12:04,040
What does this context here that is inside of my class.

178
00:12:04,050 --> 00:12:06,200
This day use stuff past class.

179
00:12:06,200 --> 00:12:06,970
OK.

180
00:12:07,130 --> 00:12:15,350
See here I am actually initialising this object and then 11:57 I am actually initialising this progress.

181
00:12:15,350 --> 00:12:21,200
They lack insight this constructor's of progress they lag assignment operator new progress dialog and

182
00:12:21,200 --> 00:12:22,770
then have to pass the context.

183
00:12:22,820 --> 00:12:26,060
OK so here that I actually initialized this context.

184
00:12:26,060 --> 00:12:31,710
Now I am actually passing this context that we receive as an argument of this const constructor here.

185
00:12:31,790 --> 00:12:32,630
OK.

186
00:12:33,110 --> 00:12:38,430
And then in in lines fretty free free for two sixty nine.

187
00:12:38,480 --> 00:12:40,600
We have this on the execute method.

188
00:12:40,610 --> 00:12:46,040
So this if it is going to be executed right before the task of downloading the data from the Internet.

189
00:12:46,040 --> 00:12:46,560
OK.

190
00:12:46,700 --> 00:12:47,770
So Henri.

191
00:12:47,810 --> 00:12:51,550
And then we need to actually call this faith superba execute.

192
00:12:51,830 --> 00:12:57,410
So it can actually call the supervision version of this Meffert on pre execute and then in line sixty

193
00:12:57,550 --> 00:13:01,480
six I've referred to the name of this object progress dialog.

194
00:13:01,880 --> 00:13:05,690
That said title downloading info from iTunes.

195
00:13:05,690 --> 00:13:06,820
Please wait.

196
00:13:06,840 --> 00:13:09,650
So it is going to actually set the title for this progress.

197
00:13:09,670 --> 00:13:12,310
De-lurk and it inline 6:54.

198
00:13:12,410 --> 00:13:17,090
I am calling the Shoma of it on progress they like so progress they like that show.

199
00:13:17,780 --> 00:13:19,950
So it's going to show the user the progress they like.

200
00:13:19,970 --> 00:13:20,310
OK.

