1
00:00:00,680 --> 00:00:06,530
High students it is literally all you're going to go ahead and create up an application that can actually

2
00:00:06,530 --> 00:00:08,130
connect to a backend.

3
00:00:08,330 --> 00:00:10,370
So our passion is going to be Firebrace.

4
00:00:10,380 --> 00:00:13,990
So let me actually open the of the web browser here.

5
00:00:14,270 --> 00:00:21,170
So as you can see here this is my other browser and you actually just put this address inside your address

6
00:00:21,170 --> 00:00:22,830
bar in your browser.

7
00:00:22,910 --> 00:00:25,820
Firebase that Google that come right.

8
00:00:25,820 --> 00:00:27,680
And then you will be guided to this page.

9
00:00:27,980 --> 00:00:34,760
And as you can see here we want to use this firebase in order to actually sent data to the cloud or

10
00:00:34,790 --> 00:00:40,400
actually we can actually get the data from the cloud or we can often take it to users and we will be

11
00:00:40,520 --> 00:00:43,070
doing all these fun stuff later.

12
00:00:43,340 --> 00:00:46,720
But really we just want to send the data to the cloud.

13
00:00:46,760 --> 00:00:47,540
Right.

14
00:00:47,580 --> 00:00:54,020
So now as you can see here we can actually just create a gmail account.

15
00:00:54,020 --> 00:01:00,380
It is necessary that you create a G-mail account and you must be signed in your Gmail account.

16
00:01:00,410 --> 00:01:00,900
OK.

17
00:01:01,070 --> 00:01:03,210
And then you can actually use firebase.

18
00:01:03,230 --> 00:01:07,230
So in order to use firebase you can actually go to the consul here.

19
00:01:07,230 --> 00:01:12,540
So just click on this go to consul here and then you will be guided to this page here.

20
00:01:12,560 --> 00:01:19,400
So let's actually wait a little bit here and now as you can see here you can actually see the projects

21
00:01:19,730 --> 00:01:21,980
that are actually created here.

22
00:01:22,040 --> 00:01:22,500
Right.

23
00:01:22,520 --> 00:01:29,180
So we can actually click click on this create a new project but we don't want to create a new project

24
00:01:29,180 --> 00:01:29,800
here.

25
00:01:30,020 --> 00:01:32,220
The Android studio 2.2.

26
00:01:32,320 --> 00:01:32,890
OK.

27
00:01:33,190 --> 00:01:39,590
It has actually capabilities in order to actually create a project and sync sync.

28
00:01:39,590 --> 00:01:45,080
The project we can actually connect our app to the firebase and use the capabilities of the Firebrace

29
00:01:45,560 --> 00:01:52,680
so make sure that you actually update Android studio into their newest actually version.

30
00:01:52,820 --> 00:01:53,390
OK.

31
00:01:53,630 --> 00:01:58,730
And you can actually open the Android studio here as you can see so as you can see the version of Mandrake

32
00:01:58,730 --> 00:02:00,330
studio is 2.2.

33
00:02:00,350 --> 00:02:06,860
So make sure that you actually have updated your own studio to the latest version and then you can actually

34
00:02:08,030 --> 00:02:09,170
create on your project.

35
00:02:09,170 --> 00:02:14,780
So just click on the start in your Android studio project and for the application name just type in

36
00:02:14,780 --> 00:02:15,800
here.

37
00:02:16,040 --> 00:02:18,910
Boxer data right.

38
00:02:18,920 --> 00:02:20,580
So this is our application name.

39
00:02:20,780 --> 00:02:22,450
And then click on next.

40
00:02:22,610 --> 00:02:29,260
And here we can actually specify the minimum SDK so that the minimum is the case that you want to actually

41
00:02:29,300 --> 00:02:29,630
use.

42
00:02:29,630 --> 00:02:33,940
Is this what APR 19 Android 4.1 $4.40.

43
00:02:33,950 --> 00:02:40,010
So as you can see here we can actually support seventy three point nine percent of the devices that

44
00:02:40,070 --> 00:02:44,830
are up in the Google place that are actually active under Google place.

45
00:02:44,840 --> 00:02:45,980
Right.

46
00:02:46,010 --> 00:02:55,900
So now we can actually use all actually our other versions of these of these Android.

47
00:02:55,920 --> 00:03:03,940
You can actually use API 9 or 10 or any API that you want but you want to choose API 1940s application

48
00:03:04,490 --> 00:03:10,420
and then click on next and he has to empty activity and then click on next.

49
00:03:10,460 --> 00:03:16,210
And here we can specify the activity name and the layout name and make sure that this checkbox is actually

50
00:03:16,210 --> 00:03:22,250
the text and generates layout file and make sure that also this checkbox is actually checked on backwards

51
00:03:22,250 --> 00:03:23,310
compatibility.

52
00:03:23,450 --> 00:03:25,080
And then click on finish.

53
00:03:25,370 --> 00:03:29,540
So now as you can see here it can actually create our project for us.

54
00:03:29,540 --> 00:03:32,070
So it's going to set the project here.

55
00:03:32,330 --> 00:03:38,090
And now as you can see our project is created we should actually wait a little bit here in order to

56
00:03:38,560 --> 00:03:43,820
dig a cradle to be built here and now as you can see our project is ready.

57
00:03:44,090 --> 00:03:52,770
So in order to actually use the firebase here just click on Tools at the top and then click on firebase.

58
00:03:53,000 --> 00:03:53,850
Right.

59
00:03:54,020 --> 00:03:58,490
And he had it because we want to actually send data to the cloud here.

60
00:03:58,490 --> 00:04:01,320
Just click on this real time database database here.

61
00:04:01,340 --> 00:04:01,670
Right.

62
00:04:01,670 --> 00:04:06,620
So if you look at this window that is open here its name is assistance right.

63
00:04:06,620 --> 00:04:12,590
Just click on this real time database here and now as you can see here we have a new button here right.

64
00:04:12,590 --> 00:04:15,470
We have actually a link save and retrieve data.

65
00:04:15,470 --> 00:04:22,790
So just click on this link here or button and now as you can see here this page is actually open for

66
00:04:22,790 --> 00:04:23,330
us.

67
00:04:23,330 --> 00:04:26,910
So now it says connect your app to firebase.

68
00:04:26,990 --> 00:04:32,900
So click on the spot in here connects to firebase and now it says as you can see a dialog is opened

69
00:04:32,960 --> 00:04:37,050
and it says start connecting to Diala is kinda like right.

70
00:04:37,220 --> 00:04:38,710
So let's actually leave it here.

71
00:04:38,960 --> 00:04:44,780
So it's gonna connect this app our application box or data to that firebase.

72
00:04:44,780 --> 00:04:51,740
So if you are actually using this feature for the first time it's going to actually open up your browser

73
00:04:51,770 --> 00:04:58,700
and it's going to actually ask you to allow the firebase to actually access some of the data of your

74
00:04:58,970 --> 00:05:00,220
account.

75
00:05:00,560 --> 00:05:07,000
And then it says create new firebase project and it says you can actually specify the actually the regions

76
00:05:07,010 --> 00:05:11,130
to make sure that the app name here is the same as your name here.

77
00:05:11,150 --> 00:05:12,070
Box or data.

78
00:05:12,080 --> 00:05:17,310
So don't change the value here and here make sure that this checkbox is checked.

79
00:05:17,320 --> 00:05:18,950
Create new file based project.

80
00:05:18,950 --> 00:05:25,310
It is very important and you can specify the country or region here and then click on Connect to Firebrace.

81
00:05:25,340 --> 00:05:31,840
So it's going to actually start creating the project this firebase project for us in the cloud.

82
00:05:32,000 --> 00:05:34,480
So you don't have to do anything here.

83
00:05:34,650 --> 00:05:35,270
OK.

84
00:05:35,390 --> 00:05:37,510
You just have to wait a little bit here.

85
00:05:37,520 --> 00:05:44,030
So now as you can see here it says firebase project created and connected to locally to match your app.

86
00:05:44,030 --> 00:05:44,440
OK.

87
00:05:44,540 --> 00:05:49,520
So we have successfully connected our application boxes data to the firebase.

88
00:05:49,520 --> 00:05:50,210
Right.

89
00:05:50,210 --> 00:05:53,450
So now as you can see here we have this value in green.

90
00:05:53,450 --> 00:05:56,180
It says connected OK connected.

91
00:05:56,180 --> 00:05:59,690
So we have now we need to actually do that the second step.

92
00:05:59,690 --> 00:06:02,480
And it says at the real time database to your app.

93
00:06:02,480 --> 00:06:08,950
So because we want to actually use this realtime database here we need to actually add this realtime

94
00:06:08,960 --> 00:06:10,620
database to our application.

95
00:06:10,640 --> 00:06:13,730
So just click on this at the realtime database to your app.

96
00:06:14,120 --> 00:06:19,400
And here are daylight opens as you can see here and we need to actually click on accept changes.

97
00:06:19,400 --> 00:06:23,660
So it's going to actually add some lines of code to your grade files.

98
00:06:23,660 --> 00:06:27,230
So let me tell you that we have two types of great files.

99
00:06:27,230 --> 00:06:32,160
We have a project level cradle file and we have an applicable grade of white.

100
00:06:32,300 --> 00:06:38,600
So now as you can see here inside this project structure we have this part in here we have these two

101
00:06:38,660 --> 00:06:39,530
little triangles.

102
00:06:39,530 --> 00:06:43,490
If I click on them here we have actually some views.

103
00:06:43,580 --> 00:06:45,440
So just click on this project view.

104
00:06:45,760 --> 00:06:47,670
And now this is our project view right.

105
00:06:47,720 --> 00:06:52,220
And if we actually open this folder or a box of 8 or we have this built that the cradle file which is

106
00:06:52,220 --> 00:06:53,860
actually inside this box or data.

107
00:06:53,870 --> 00:06:58,800
So this file is called Project Libelle built that cradle fight.

108
00:06:58,850 --> 00:07:04,610
And now as you can see here we have this app file there and if we open it as you can see we have this

109
00:07:04,820 --> 00:07:10,610
inside this app folder we have this build that cradle file which is actually called app level cradle

110
00:07:10,670 --> 00:07:12,180
built that great white.

111
00:07:12,500 --> 00:07:18,060
So now as you can see here we have a new file inside this for the Google dash services that Jason.

112
00:07:18,160 --> 00:07:18,670
OK.

113
00:07:18,680 --> 00:07:25,070
This file is either by the Google this by the Android studio so that they can actually use the Firebrace

114
00:07:25,490 --> 00:07:26,710
in our application.

115
00:07:27,080 --> 00:07:32,270
So you don't have to worry about this here you don't have to worry about the speed that cradle here

116
00:07:32,450 --> 00:07:38,410
because all the codes are actually added automatically by the Android studio for now.

117
00:07:38,450 --> 00:07:44,570
Let's actually open our activity underlaid minute example here and then let's actually click on hello

118
00:07:44,570 --> 00:07:48,820
world here and and press on the key on your keyboard.

119
00:07:48,890 --> 00:07:53,060
And now let's actually drag up the text field.

120
00:07:53,090 --> 00:07:57,890
So as you can see here inside these text fields there we have this plain text here right.

121
00:07:57,890 --> 00:08:00,330
So just select it and just put it here.

122
00:08:00,470 --> 00:08:02,820
As you can see here we have this relatively out.

123
00:08:02,900 --> 00:08:08,610
So just put it at the center and then here let's actually drag a button.

124
00:08:08,780 --> 00:08:14,520
So inside these widgets whether we have this button to just select and do like it here below this textfield.

125
00:08:14,570 --> 00:08:15,200
Right.

126
00:08:15,470 --> 00:08:18,030
And then so just select is textfield here.

127
00:08:18,080 --> 00:08:19,010
This edit text.

128
00:08:19,190 --> 00:08:26,780
And for the ID just type in EDT value right and then person entity on your keyboard.

129
00:08:27,250 --> 00:08:32,510
And then here as you can see we have this text attribute of this text field.

130
00:08:32,560 --> 00:08:37,660
So it does name value here and now.

131
00:08:37,740 --> 00:08:48,180
So select the spot in here and for the ID just type in here PTEN scent value to server.

132
00:08:48,670 --> 00:08:52,050
So this is the ID Beati and sent value to server.

133
00:08:52,150 --> 00:09:01,620
And for the text that just typed in here sent data to server and that person enter here on your keyboard.

134
00:09:02,170 --> 00:09:06,080
And now let's get you to go inside this main activity that double file here.

135
00:09:06,280 --> 00:09:13,630
And inside is uncreate effectless actually create two objects that we need to create in order to interact

136
00:09:13,630 --> 00:09:15,520
with the user interface components.

137
00:09:15,520 --> 00:09:19,000
So as you can see here the first object is actually a textfield right.

138
00:09:19,240 --> 00:09:24,340
So now let's actually go inside this main activity the audio file and that's just a reverse of the name

139
00:09:24,340 --> 00:09:25,840
of these text class.

140
00:09:25,840 --> 00:09:29,030
So it is text and the name of an object is going to be EDT.

141
00:09:29,110 --> 00:09:31,250
Value assignment operator.

142
00:09:31,420 --> 00:09:39,220
And then I need to cast this object to a it takes object find view by ID or that Id dot EDT value and

143
00:09:39,220 --> 00:09:41,810
then put a semicolon at the end of your statement.

144
00:09:41,830 --> 00:09:46,290
And now let's actually create an object of type BOTTEN so potent.

145
00:09:46,390 --> 00:09:55,550
The name is going to be between sent and send data to a server and then put an assignment operator here.

146
00:09:55,570 --> 00:10:04,390
And then let's actually cast this object to a button object find view by ID or thought Id dot between

147
00:10:04,540 --> 00:10:09,490
cint value to server and then put a semicolon at the end of your statement.

148
00:10:09,490 --> 00:10:15,000
And now let's actually first with the name of our variable which actually holds this instance.

149
00:10:15,010 --> 00:10:20,710
So as you can see here we have actually a variable which is of bottom right and this variable holds

150
00:10:20,890 --> 00:10:23,160
this Potten instance right.

151
00:10:23,200 --> 00:10:28,780
So now we can actually refer to the name of the Spot an object or instance PTEN sent data to a server

152
00:10:28,870 --> 00:10:31,870
that said unclick listener.

153
00:10:32,230 --> 00:10:38,830
And then just put the value new and then just put the letter capital V.

154
00:10:39,120 --> 00:10:44,620
And now the autocomplete feature of the Android studio is helping me to choose this option unclick listener.

155
00:10:44,800 --> 00:10:49,460
And if I actually choose this option here as you can see inside the curly braces it is dot dot dot.

156
00:10:49,480 --> 00:10:53,340
So choose this option here and then present into the key on your keyboard.

157
00:10:53,690 --> 00:10:57,250
And now it's going to automatically put these lines of code here.

158
00:10:57,250 --> 00:10:57,840
Right.

159
00:10:57,880 --> 00:11:07,290
So now as you can see here we have actually an anonymous inner class here that actually implements this.

160
00:11:07,300 --> 00:11:09,100
Unclick listener interface.

161
00:11:09,190 --> 00:11:14,680
And because that anonymous inner class implements this unclick listener interface we must actually provide

162
00:11:14,710 --> 00:11:19,770
an implementation for this uncle it that is inside of his uncle uncle Ackerson an interface.

163
00:11:19,780 --> 00:11:25,360
So let's actually go inside the curly braces of this uncle Comerford and first of all we need to actually

164
00:11:25,390 --> 00:11:28,450
create our reference to our database.

165
00:11:28,480 --> 00:11:28,930
Right.

166
00:11:28,990 --> 00:11:38,040
So now let's actually open our web browser here and now let me actually just refresh this page here

167
00:11:38,070 --> 00:11:42,990
because we actually created an application in Andrew's studio and we connected that application to the

168
00:11:42,990 --> 00:11:43,650
fireplace.

169
00:11:43,680 --> 00:11:50,130
So if I now actually just refresh this page here it's going to show me the application that is created

170
00:11:50,130 --> 00:11:50,680
here.

171
00:11:50,700 --> 00:11:53,840
So as you can see here we have these boxes data application.

172
00:11:53,900 --> 00:11:54,350
Right.

173
00:11:54,360 --> 00:11:58,460
This application is actually created here for me automatically by the Android studio.

174
00:11:58,590 --> 00:12:03,110
And firebase So if I actually click on this application here this project.

175
00:12:03,110 --> 00:12:05,160
So just click on it.

176
00:12:05,160 --> 00:12:07,350
And now this is our project right.

177
00:12:07,380 --> 00:12:09,530
So now we can see these panels.

178
00:12:09,540 --> 00:12:16,440
We can see these options and here because we want to just send the data to the database for this application

179
00:12:16,480 --> 00:12:22,560
later we will be actually creating more and more complex applications by using a firebase But for now

180
00:12:22,560 --> 00:12:25,770
we just want to send it to the server.

181
00:12:25,770 --> 00:12:27,630
So we want to learn how to do that.

182
00:12:27,660 --> 00:12:34,580
So just here as you can see in the left hand sidebar as you can see we have this database option here.

183
00:12:34,650 --> 00:12:35,060
Right.

184
00:12:35,160 --> 00:12:36,340
So just click on it.

185
00:12:36,700 --> 00:12:41,750
And now as you can see which we have this real database here right.

186
00:12:41,850 --> 00:12:43,580
And we have some taps here.

187
00:12:43,580 --> 00:12:45,990
They tell rules usage backups.

188
00:12:45,990 --> 00:12:51,990
So just click on these rules here as you can see inside this data here in this data page.

189
00:12:51,990 --> 00:12:58,190
We have these values and this is our database this is going to be our reference to our database so we

190
00:12:58,200 --> 00:13:01,690
can actually use this instance in order to actually create our own objects.

191
00:13:01,830 --> 00:13:07,320
But for not just don't think about it here as you can see we have these rules pop here right.

192
00:13:07,320 --> 00:13:12,680
Just click on it and now we have this is actually based on data.

193
00:13:13,110 --> 00:13:19,960
And now it says that Threet colon and insert the codes it says off is not equal to NULL.

194
00:13:20,250 --> 00:13:22,550
And we have this dot right colon.

195
00:13:22,710 --> 00:13:26,600
And instead of double quotes it says all of is not equal to a lot.

196
00:13:26,610 --> 00:13:32,640
And it says that if the user is not actually authenticated if the user is not registered as the user

197
00:13:32,640 --> 00:13:37,060
of the application that user is not allowed to actually interact with the database.

198
00:13:37,230 --> 00:13:42,670
So we don't want to actually authenticate here because I'll talk more about authentication later.

199
00:13:42,720 --> 00:13:46,760
We will be actually creating an application in order to have any authenticated user.

200
00:13:46,830 --> 00:13:49,540
But for now we just we don't want to authenticate.

201
00:13:49,590 --> 00:13:58,140
So just delete these exclamation mark here and put another equal operator and again delete these exclamation

202
00:13:58,140 --> 00:14:03,280
marks here and put another equal operator and then we can publish here as you can't see.

203
00:14:03,330 --> 00:14:06,940
So let's actually wait a little bit here and it says rules published.

204
00:14:06,960 --> 00:14:07,730
Right.

205
00:14:07,740 --> 00:14:13,470
So let's go back to that date tap here and now we want to actually send the data here and we will be

206
00:14:13,530 --> 00:14:15,090
watching the data here.

207
00:14:15,090 --> 00:14:17,030
So let's actually go back to android studio.

