1
00:00:00,150 --> 00:00:05,850
Hire everyone in this theater all we're gonna go ahead and create another Android application.

2
00:00:05,850 --> 00:00:06,750
So just click on this.

3
00:00:06,750 --> 00:00:12,930
Start in your Android studio project here and then for the name of your application just step in here

4
00:00:12,960 --> 00:00:21,960
app 54 and then click on next and here choose AP A16 Android 4.1 Jelly Bean for a minimum SDK and then

5
00:00:21,960 --> 00:00:29,260
click on next and here choose empty activity here and then click on next and here click on finish.

6
00:00:29,460 --> 00:00:33,140
So now as you can see here our project is actually created.

7
00:00:33,210 --> 00:00:35,890
So it's actually double and it's a race folder here.

8
00:00:36,030 --> 00:00:41,270
And then double double click on the layout for there and then return this activity underline minute

9
00:00:41,280 --> 00:00:41,980
example.

10
00:00:42,090 --> 00:00:46,380
So here first of all we want to actually design the user interface of our application.

11
00:00:46,530 --> 00:00:51,920
So just select is hellova over the text view here and then press on delete key on your keyboard.

12
00:00:52,110 --> 00:00:57,950
So first of all we need to actually write a linearly or two vertical into this relatively out here.

13
00:00:58,050 --> 00:01:03,550
So just put this linearly out vertical at the center of this relatively here.

14
00:01:03,900 --> 00:01:07,270
And then let's actually drag our textfield.

15
00:01:07,500 --> 00:01:13,170
Let's actually select is a plain text here inside this text fields a folder just select it and put it

16
00:01:13,230 --> 00:01:16,250
at the center of this linearly at vertical.

17
00:01:16,260 --> 00:01:16,900
OK.

18
00:01:17,190 --> 00:01:19,740
So WDTN this eddy takes here.

19
00:01:19,740 --> 00:01:23,620
And for the ID just type in here it is the content.

20
00:01:23,700 --> 00:01:29,640
It is the content title and and press on entelechy on your keyboard.

21
00:01:29,880 --> 00:01:35,820
And then let's actually find the hint attribute that is actually related to this text field inside this

22
00:01:35,820 --> 00:01:39,030
property section here as you can see this is the hint attribute.

23
00:01:39,030 --> 00:01:39,550
OK.

24
00:01:39,600 --> 00:01:49,180
So for the hand just type in here please enter the title of notification.

25
00:01:49,470 --> 00:01:49,790
OK.

26
00:01:49,800 --> 00:01:52,470
And that person entelechy on your keyboard.

27
00:01:52,470 --> 00:01:55,310
So as you can see here this is the heat of this stakes field.

28
00:01:55,560 --> 00:01:59,880
So let's actually and other textfield into this linearly at vertical.

29
00:01:59,880 --> 00:02:01,810
So inside this it takes field folder.

30
00:02:01,920 --> 00:02:08,490
Just select the plain text here and put it at the center of this linearly alphabetical double click

31
00:02:08,490 --> 00:02:09,150
on it.

32
00:02:09,150 --> 00:02:17,970
And for the ID just type in here EDT a content editing content text and in person Enter key on your

33
00:02:17,970 --> 00:02:23,270
keyboard and let's actually assign a value to the hint of this edit takes.

34
00:02:23,280 --> 00:02:34,980
So for the hand to step in here please enter the text of please enter the text of notification

35
00:02:38,410 --> 00:02:40,680
and then person entelechy on your keyboard.

36
00:02:40,990 --> 00:02:42,850
So let's actually select this one here.

37
00:02:42,920 --> 00:02:50,290
This first textfield and for the Heyns just put this capital-T let me actually change this t to capital-T

38
00:02:50,470 --> 00:02:53,550
title and then press on interview on your keyboard.

39
00:02:53,560 --> 00:02:58,130
So now it's actually the right button here into this linearly aesthetical.

40
00:02:58,150 --> 00:03:01,990
So as you can see here I have this button inside widgets folder.

41
00:03:01,990 --> 00:03:07,970
Just select it and put it at the center of this linearly vertical and double click on it.

42
00:03:08,010 --> 00:03:10,590
And for the text it's just typing here.

43
00:03:10,660 --> 00:03:13,650
Notify notify me.

44
00:03:14,200 --> 00:03:21,570
And for the ideas they've been here between notify and then present Enter key on your keyboard.

45
00:03:21,580 --> 00:03:26,680
So let's actually go inside this main activity file here and now this actually declares some objects

46
00:03:26,740 --> 00:03:28,900
inside this main activity class.

47
00:03:28,900 --> 00:03:35,590
So first of all I need to actually declare an edit text object so EDT a content

48
00:03:38,080 --> 00:03:49,600
title and then put a semi-colon at the end of your statement and again Eddie takes EDT content text.

49
00:03:49,940 --> 00:03:52,910
And again I need to put a semi-colon at the end of my statement.

50
00:03:52,910 --> 00:03:56,610
And here again I want to actually declare about a button.

51
00:03:56,720 --> 00:03:59,060
So PTEN notify.

52
00:03:59,900 --> 00:04:02,750
And then I need to put a semicolon at the end of my statement.

53
00:04:02,750 --> 00:04:09,320
So again inside the uncreate Meffert we need to actually instantiate these objects that we declared

54
00:04:09,380 --> 00:04:11,150
inside this in a computer class.

55
00:04:11,180 --> 00:04:16,850
So first what you want to instantiate is then create this EDT content's titel assignment operator.

56
00:04:16,850 --> 00:04:25,830
So here I need to cestus object to a it takes object find you by ID or that ID that EDT content title

57
00:04:26,050 --> 00:04:32,690
and that I need to put a semicolon at the end of my statement and ADT cont'd text assignment operator.

58
00:04:32,840 --> 00:04:42,760
And then here I need to cast this object to a detailed object find view by ID or ID that it is EDT content.

59
00:04:44,370 --> 00:04:50,290
TEXT So a French dad of it didn't assign an ID to this second.

60
00:04:50,770 --> 00:04:56,620
So I made a mistake inside this activity Underland minute exam and I assigned is city.

61
00:04:56,690 --> 00:04:58,770
So I need to change the C to D.

62
00:04:58,950 --> 00:04:59,200
OK.

63
00:04:59,210 --> 00:05:01,490
And then I need to press on into the key on my keyboard.

64
00:05:01,770 --> 00:05:04,060
So let's go back to our main activity that java file.

65
00:05:04,080 --> 00:05:07,950
So is it the content or text.

66
00:05:08,270 --> 00:05:08,900
Okay.

67
00:05:08,970 --> 00:05:11,630
And then I need to put a semicolon at the end of my statement.

68
00:05:11,880 --> 00:05:18,740
And here I need to again instantiate this PTEN notify object so notify assignment operator and that

69
00:05:18,740 --> 00:05:26,540
he or I need to chastise object to a button object find view ID or that Id towards Pythian notify and

70
00:05:26,540 --> 00:05:29,080
that I need to put a semicolon at the end of my statement.

71
00:05:29,370 --> 00:05:34,880
And here I need to actually make the Spartan BT and notify our listener to the clicks of the user.

72
00:05:34,980 --> 00:05:41,850
So here I can't just type in between not notify that sets unclick listener and that I need to pass the

73
00:05:41,850 --> 00:05:47,760
context so the context is going to be my inactivity that this and here at the top I need to actually

74
00:05:47,760 --> 00:05:55,770
implement this view that Uncle listener interface so views that unclick listener.

75
00:05:56,040 --> 00:06:00,650
And then we need to actually override the ankle Comerford inside our main activity class.

76
00:06:00,720 --> 00:06:06,740
So he had I had just been unclick and he and as you can see we are all in this uncle Mefford inside.

77
00:06:06,750 --> 00:06:11,760
Our main activity class and as you can see here the errors are gone and our application is actually

78
00:06:12,060 --> 00:06:14,570
compiling our codes are compiling now.

79
00:06:14,760 --> 00:06:21,210
So now inside our main activity class I'm going to actually paste in a method here and then I'm going

80
00:06:21,210 --> 00:06:24,240
to explain to you what's going on here.

81
00:06:24,840 --> 00:06:29,450
So as you can see here these are the lines of code that actually pasted here.

82
00:06:29,460 --> 00:06:32,050
So as you can see I have my foot here.

83
00:06:32,280 --> 00:06:38,730
And the access modifier of this method is private's and the return type of this method is void.

84
00:06:38,850 --> 00:06:41,360
And this means that this if it returns nothing.

85
00:06:41,430 --> 00:06:42,010
OK.

86
00:06:42,240 --> 00:06:45,460
And the name of this method is shown notification.

87
00:06:45,480 --> 00:06:47,930
So you want to show a notification to the user.

88
00:06:48,000 --> 00:06:48,610
OK.

89
00:06:48,900 --> 00:06:55,650
So in line 44 in order to actually create on notification and in order to show notification to the user

90
00:06:56,010 --> 00:07:01,760
first that what we need to actually create a notification compact that build that object.

91
00:07:01,770 --> 00:07:08,630
So here as you can see I created this object Builder which is of type notification combat compact that

92
00:07:08,700 --> 00:07:09,090
builder.

93
00:07:09,090 --> 00:07:09,730
OK.

94
00:07:10,080 --> 00:07:13,190
And here as you can see I am instantiating this object.

95
00:07:13,230 --> 00:07:15,560
New notification compact that builder.

96
00:07:15,750 --> 00:07:23,330
And here as an argument we need to pass the context so the context is main activity that is an inline

97
00:07:23,370 --> 00:07:25,320
45 as you can see here.

98
00:07:25,410 --> 00:07:30,720
I am actually specifying the icon of the notification that I am to show to the user.

99
00:07:30,900 --> 00:07:37,420
So I refer to this builder here builder that set small icon as you can see here.

100
00:07:37,440 --> 00:07:40,920
I want to set a small icon for this notification.

101
00:07:41,080 --> 00:07:42,680
Arthur triable that image.

102
00:07:42,840 --> 00:07:49,380
So on my desktop I have an image for this notification that I actually downloaded from the Internet.

103
00:07:49,410 --> 00:07:50,510
So this is the image.

104
00:07:50,700 --> 00:07:51,230
OK.

105
00:07:51,390 --> 00:07:57,930
I just need to actually copy this image so I just need to right click on this image here and then click

106
00:07:57,930 --> 00:08:05,940
on copy copy image that PMG and let's actually go to an android studio and here inside our project structure

107
00:08:06,270 --> 00:08:12,240
inside this press folder just select this triable for rebel directory here as you can see right click

108
00:08:12,240 --> 00:08:15,230
on it and then click on paste.

109
00:08:15,240 --> 00:08:17,460
So now click on OK here.

110
00:08:17,550 --> 00:08:21,190
So as you can see here now I have this image inside my drivable folder.

111
00:08:21,390 --> 00:08:25,610
So let's go back to our main activity class and as you can see I am actually setting this image are

112
00:08:25,640 --> 00:08:32,390
that triable that image for this small icon of thus far this small icon of this notification.

113
00:08:32,420 --> 00:08:34,230
OK Bill that's a smile icon.

114
00:08:34,230 --> 00:08:41,220
So as you can see here I am actually specifying the text of the of the notification that I want to show

115
00:08:41,220 --> 00:08:41,880
to the user.

116
00:08:41,970 --> 00:08:44,990
So Bill there that sit content text.

117
00:08:45,120 --> 00:08:45,650
OK.

118
00:08:45,870 --> 00:08:52,260
So the content taste is going to be the value of these are textfield of this I to go back to our activity

119
00:08:52,260 --> 00:08:53,550
mainit example.

120
00:08:53,550 --> 00:08:55,910
So here I just need to click on this clear cache.

121
00:08:56,520 --> 00:09:02,620
So as you can see here for the notification content takes as you can see I just need to get this value

122
00:09:02,620 --> 00:09:05,240
with the value of this text field here.

123
00:09:05,260 --> 00:09:10,360
As you can see so sort of naturally DoubleClick and distasteful as you can see the idea is content takes.

124
00:09:10,380 --> 00:09:11,070
Right.

125
00:09:11,130 --> 00:09:16,780
So you want to get this value and put that as the value of the text of this notification.

126
00:09:16,800 --> 00:09:17,250
OK.

127
00:09:17,300 --> 00:09:18,710
So that content text.

128
00:09:18,760 --> 00:09:22,280
So editing content text that text that was thrown.

129
00:09:22,560 --> 00:09:26,980
As you can see here I want to actually get this value and convert it to a string value.

130
00:09:27,180 --> 00:09:32,790
And then I can actually pass that value as the argument as the argument of this content text here.

131
00:09:32,820 --> 00:09:39,600
As you can see and hear in line 47 I am specifying the title of the content sort of the title of the

132
00:09:39,600 --> 00:09:41,670
notification that you want to show to the user.

133
00:09:41,760 --> 00:09:48,250
So there that content to title edit content text that get text that 2st.

134
00:09:48,360 --> 00:09:55,340
So here as you can see I need to change the EDT content text to EDT content title.

135
00:09:55,440 --> 00:09:59,940
So you want to actually get the content to hightail it Itay content title.

136
00:10:00,000 --> 00:10:03,270
So insight or activity under alignment affects them in here.

137
00:10:03,660 --> 00:10:06,200
As you can see I have the added text here right.

138
00:10:06,210 --> 00:10:08,440
Please enter the title of the notification.

139
00:10:08,490 --> 00:10:13,560
So if Y.W.C.A. edit takes here as you can see the title is it its contents title.

140
00:10:13,560 --> 00:10:19,200
So you want to get the text of this editor of this text field and when all you want to actually use

141
00:10:19,200 --> 00:10:22,620
that as the title of the notification that you want to show to the user.

142
00:10:22,860 --> 00:10:28,760
So as you can see here this is going to be the title EDT contents title that get text that was strange

143
00:10:29,100 --> 00:10:34,430
and then I can actually pass that value as the argument of the Smurfette so content title of this bill

144
00:10:34,430 --> 00:10:35,070
that object.

145
00:10:35,070 --> 00:10:35,900
OK.

146
00:10:36,570 --> 00:10:39,420
So here as you can see I have a comment.

147
00:10:39,420 --> 00:10:40,680
I created a comment here.

148
00:10:40,800 --> 00:10:46,370
So use it on click on notification so when the user clicks on the notification what it is going to happen.

