1 00:00:00,300 --> 00:00:01,133 ‫-: Hi. 2 00:00:01,133 --> 00:00:02,130 ‫Within this lecture 3 00:00:02,130 --> 00:00:05,130 ‫we are going to complete our Firebased integration 4 00:00:05,130 --> 00:00:10,130 ‫by adding the specified dependencies in our documentation. 5 00:00:11,040 --> 00:00:15,450 ‫So, over here it says that you have to add these SDKs 6 00:00:15,450 --> 00:00:17,970 ‫for desired Firebased products. 7 00:00:17,970 --> 00:00:22,050 ‫And it gives us a webpage over here, actually. 8 00:00:22,050 --> 00:00:23,880 ‫So, I'm going to open this web page. 9 00:00:23,880 --> 00:00:26,910 ‫So, if you don't see this, then don't worry. 10 00:00:26,910 --> 00:00:30,300 ‫I'm going to show you exactly what to write over here. 11 00:00:30,300 --> 00:00:32,250 ‫But just for reference, 12 00:00:32,250 --> 00:00:33,390 ‫I'm going to open this 13 00:00:33,390 --> 00:00:34,890 ‫and show it to you. 14 00:00:34,890 --> 00:00:36,660 ‫So, why are we doing this? 15 00:00:36,660 --> 00:00:41,220 ‫Why are we adding some different libraries? 16 00:00:41,220 --> 00:00:45,090 ‫Why doesn't it come all together? 17 00:00:45,090 --> 00:00:46,800 ‫So, as you can see, 18 00:00:46,800 --> 00:00:49,950 ‫Firebase has a lot of modules. 19 00:00:49,950 --> 00:00:53,070 ‫Like, it has its own advertisement module. 20 00:00:53,070 --> 00:00:55,680 ‫It has its own cloud messaging, 21 00:00:55,680 --> 00:01:00,680 ‫like storage, and database, AdMob, analytics. 22 00:01:01,620 --> 00:01:06,060 ‫Remember, we didn't even enable analytics in our app. 23 00:01:06,060 --> 00:01:08,940 ‫So, these are all for different reasons, 24 00:01:08,940 --> 00:01:10,560 ‫different purposes. 25 00:01:10,560 --> 00:01:13,200 ‫So, if you're using everything related 26 00:01:13,200 --> 00:01:15,810 ‫to Firebase in your application, 27 00:01:15,810 --> 00:01:18,900 ‫of course, you're gonna have to add them all together. 28 00:01:18,900 --> 00:01:21,510 ‫But, if you're not going to use, 29 00:01:21,510 --> 00:01:24,420 ‫then why do you want to edit, right? 30 00:01:24,420 --> 00:01:26,580 ‫Because it will make your project bigger, 31 00:01:26,580 --> 00:01:28,170 ‫it will make your project slower, 32 00:01:28,170 --> 00:01:31,050 ‫if you add everything, all together. 33 00:01:31,050 --> 00:01:32,640 ‫So, rather than this, 34 00:01:32,640 --> 00:01:36,270 ‫Firebase actually separated every module 35 00:01:36,270 --> 00:01:38,610 ‫into its own dependency, 36 00:01:38,610 --> 00:01:41,190 ‫and it advises to download 37 00:01:41,190 --> 00:01:44,040 ‫what you really need in your project. 38 00:01:44,040 --> 00:01:46,770 ‫So, this is exactly what we are going to do 39 00:01:46,770 --> 00:01:48,270 ‫in this lecture. 40 00:01:48,270 --> 00:01:51,300 ‫So, we are not going to use analytics, 41 00:01:51,300 --> 00:01:52,133 ‫for example, 42 00:01:52,133 --> 00:01:56,130 ‫we are not going to use cloud storage. 43 00:01:56,130 --> 00:01:57,420 ‫So, cloud storage is 44 00:01:57,420 --> 00:02:00,330 ‫for storing pictures or videos, 45 00:02:00,330 --> 00:02:03,000 ‫like media, in your app. 46 00:02:03,000 --> 00:02:05,400 ‫So, we are not going to need it, okay? 47 00:02:05,400 --> 00:02:07,050 ‫We are building a Twitter app. 48 00:02:07,050 --> 00:02:10,980 ‫We are only going to share strings like data, 49 00:02:10,980 --> 00:02:14,130 ‫and we can save all them to database. 50 00:02:14,130 --> 00:02:16,170 ‫And that's what we are going to do. 51 00:02:16,170 --> 00:02:19,140 ‫We are going to bring in Firestore, 52 00:02:19,140 --> 00:02:20,970 ‫which is a database. 53 00:02:20,970 --> 00:02:21,870 ‫And, for example, 54 00:02:21,870 --> 00:02:24,270 ‫we are going to use authentication modules, 55 00:02:24,270 --> 00:02:25,590 ‫because remember, 56 00:02:25,590 --> 00:02:27,720 ‫we had some username 57 00:02:27,720 --> 00:02:29,550 ‫and password login page. 58 00:02:29,550 --> 00:02:31,440 ‫So, we are going to bring in this, 59 00:02:31,440 --> 00:02:32,640 ‫but we are not going to 60 00:02:32,640 --> 00:02:34,200 ‫bring in cloud messaging, 61 00:02:34,200 --> 00:02:38,250 ‫or other dynamic links, or in-app messaging, 62 00:02:38,250 --> 00:02:41,250 ‫like machine learning kit and stuff. 63 00:02:41,250 --> 00:02:43,830 ‫So, we are going to take what we need. 64 00:02:43,830 --> 00:02:45,090 ‫And in order to do that, 65 00:02:45,090 --> 00:02:48,690 ‫I suggest you come to my GitHub page. 66 00:02:48,690 --> 00:02:49,523 ‫Of course, 67 00:02:49,523 --> 00:02:50,356 ‫you can copy and paste it 68 00:02:50,356 --> 00:02:52,530 ‫from that documentation, as well, 69 00:02:52,530 --> 00:02:54,660 ‫but it might be a little bit confusing, 70 00:02:54,660 --> 00:02:58,770 ‫if you're not an experienced developer. 71 00:02:58,770 --> 00:03:01,740 ‫So, rather, I'm going to go over my build.gradle, 72 00:03:01,740 --> 00:03:03,330 ‫under app folder, 73 00:03:03,330 --> 00:03:05,220 ‫and find the dependencies. 74 00:03:05,220 --> 00:03:06,053 ‫Okay. 75 00:03:06,053 --> 00:03:07,680 ‫This is my GitHub page, 76 00:03:07,680 --> 00:03:09,300 ‫as you can see, 77 00:03:09,300 --> 00:03:11,760 ‫and I'm going to copy and paste 78 00:03:11,760 --> 00:03:13,770 ‫this Firebase, 79 00:03:13,770 --> 00:03:18,210 ‫and actually, this recycler view of dependency, as well. 80 00:03:18,210 --> 00:03:20,430 ‫So, I'm going to copy it and paste 81 00:03:20,430 --> 00:03:22,560 ‫it on my project. 82 00:03:22,560 --> 00:03:25,230 ‫So, maybe you don't know what a recycler is. 83 00:03:25,230 --> 00:03:26,850 ‫I'm going to show you later on. 84 00:03:26,850 --> 00:03:28,320 ‫It's a view, 85 00:03:28,320 --> 00:03:31,320 ‫that we are going to use in our app. 86 00:03:31,320 --> 00:03:33,210 ‫We're going to use it to display 87 00:03:33,210 --> 00:03:35,310 ‫the tweets that we gather 88 00:03:35,310 --> 00:03:37,710 ‫from the Firebase server. 89 00:03:37,710 --> 00:03:40,770 ‫So, make sure you copy all of this, okay? 90 00:03:40,770 --> 00:03:44,970 ‫And beware that the versions might change. 91 00:03:44,970 --> 00:03:47,010 ‫It changes like every month 92 00:03:47,010 --> 00:03:49,350 ‫so, it will be a little bit different for you. 93 00:03:49,350 --> 00:03:52,080 ‫I'm going to show you what you need to do exactly, 94 00:03:52,080 --> 00:03:53,250 ‫so, don't worry. 95 00:03:53,250 --> 00:03:55,410 ‫I'm writing this under dependencies, 96 00:03:55,410 --> 00:03:57,570 ‫between two curly braces, 97 00:03:57,570 --> 00:03:59,130 ‫not somewhere else. 98 00:03:59,130 --> 00:04:01,020 ‫And after I paste it, 99 00:04:01,020 --> 00:04:03,570 ‫I'm going to hit the sync now button. 100 00:04:03,570 --> 00:04:06,450 ‫So, if you're using a version, 101 00:04:06,450 --> 00:04:08,135 ‫and if there is a newer version, 102 00:04:08,135 --> 00:04:10,800 ‫it will give you an update. 103 00:04:10,800 --> 00:04:12,690 ‫It will highlight it. 104 00:04:12,690 --> 00:04:15,930 ‫So, I'm going to show you how it looks actually. 105 00:04:15,930 --> 00:04:17,730 ‫So, if you give an error, 106 00:04:17,730 --> 00:04:19,710 ‫if you take an error, like that, 107 00:04:19,710 --> 00:04:21,240 ‫then you're gonna have to change it 108 00:04:21,240 --> 00:04:23,580 ‫to the latest version. 109 00:04:23,580 --> 00:04:25,200 ‫So right now, as you can see, 110 00:04:25,200 --> 00:04:27,450 ‫I don't get any error, 111 00:04:27,450 --> 00:04:32,450 ‫but I will show you an error instance 112 00:04:32,550 --> 00:04:36,630 ‫that we get in the build.gradle project level. 113 00:04:36,630 --> 00:04:39,360 ‫I actually notice that error before, 114 00:04:39,360 --> 00:04:40,860 ‫but in order to show you, 115 00:04:40,860 --> 00:04:44,040 ‫in a better situation, I didn't touch it. 116 00:04:44,040 --> 00:04:45,690 ‫Now, if you come over here, 117 00:04:45,690 --> 00:04:49,020 ‫you will see that there is a newer version like this. 118 00:04:49,020 --> 00:04:50,610 ‫So it says that yeah, 119 00:04:50,610 --> 00:04:54,930 ‫there is a 4.3.2, and yeah, 120 00:04:54,930 --> 00:04:58,310 ‫it's a 4.3.3 and you're using 4.3.2. 121 00:04:59,190 --> 00:05:02,100 ‫So I, if I change it, and if I hit sync now, 122 00:05:02,100 --> 00:05:05,010 ‫it'll be synchronized to the latest version, 123 00:05:05,010 --> 00:05:06,780 ‫and you are going to have to do 124 00:05:06,780 --> 00:05:09,810 ‫the exact same thing over here. 125 00:05:09,810 --> 00:05:10,643 ‫Okay? 126 00:05:10,643 --> 00:05:13,050 ‫So make sure you control the latest version 127 00:05:13,050 --> 00:05:15,210 ‫for this auth Firestore, 128 00:05:15,210 --> 00:05:16,740 ‫and recycler view, 129 00:05:16,740 --> 00:05:19,740 ‫and change them to the latest version. 130 00:05:19,740 --> 00:05:21,120 ‫And if you get an error, 131 00:05:21,120 --> 00:05:22,590 ‫you're more than welcome 132 00:05:22,590 --> 00:05:23,940 ‫to use these versions, 133 00:05:23,940 --> 00:05:28,650 ‫like 19.1.0 and 21.3.0. 134 00:05:28,650 --> 00:05:30,360 ‫But it's always a good idea 135 00:05:30,360 --> 00:05:32,160 ‫to work with latest version. 136 00:05:32,160 --> 00:05:33,000 ‫Okay? 137 00:05:33,000 --> 00:05:34,260 ‫So after you're done, 138 00:05:34,260 --> 00:05:36,330 ‫you can just close this down. 139 00:05:36,330 --> 00:05:39,240 ‫And now we synchronize everything, 140 00:05:39,240 --> 00:05:44,240 ‫and our app is actually connected with Firebase. 141 00:05:44,370 --> 00:05:45,480 ‫Okay? 142 00:05:45,480 --> 00:05:49,336 ‫So right now, if you run this on emulator, 143 00:05:49,336 --> 00:05:51,690 ‫if you don't get any errors, 144 00:05:51,690 --> 00:05:54,720 ‫it means that you successfully integrated 145 00:05:54,720 --> 00:05:57,390 ‫Firebase into your own app. 146 00:05:57,390 --> 00:05:58,223 ‫And of course, 147 00:05:58,223 --> 00:06:01,560 ‫we don't even have any code right now. 148 00:06:01,560 --> 00:06:03,540 ‫And what you are seeing right now, 149 00:06:03,540 --> 00:06:06,870 ‫is the older version that I have created, 150 00:06:06,870 --> 00:06:11,040 ‫in order to demonstrate how it works to you. 151 00:06:11,040 --> 00:06:11,873 ‫Okay? 152 00:06:11,873 --> 00:06:15,780 ‫It will just go and bring in the new version 153 00:06:15,780 --> 00:06:16,680 ‫right now, 154 00:06:16,680 --> 00:06:19,290 ‫and we will see Hello World text, 155 00:06:19,290 --> 00:06:21,330 ‫because we haven't touched it yet. 156 00:06:21,330 --> 00:06:24,030 ‫And as you can see, we don't get any errors. 157 00:06:24,030 --> 00:06:27,090 ‫It means that everything is successful. 158 00:06:27,090 --> 00:06:28,770 ‫So far, so good. 159 00:06:28,770 --> 00:06:31,050 ‫Now, we are going to stop here, 160 00:06:31,050 --> 00:06:33,060 ‫and within the next lecture we are going to 161 00:06:33,060 --> 00:06:35,070 ‫start building our app, 162 00:06:35,070 --> 00:06:37,653 ‫looking at my GitHub project.