1 00:00:00,106 --> 00:00:02,856 (cheerful music) 2 00:00:05,590 --> 00:00:06,960 Alright, so it's time to start 3 00:00:06,960 --> 00:00:08,750 creating an app that does a little bit more 4 00:00:08,750 --> 00:00:11,710 than just displaying some text on the screen. 5 00:00:11,710 --> 00:00:13,230 So in this section, we're gonna create 6 00:00:13,230 --> 00:00:16,160 a Button Click app to show how to get a button 7 00:00:16,160 --> 00:00:20,370 on the screen to perform some operation when it's clicked. 8 00:00:20,370 --> 00:00:23,160 Now we're going to use this relatively simple example 9 00:00:23,160 --> 00:00:26,470 to have a look at quite a few important concepts. 10 00:00:26,470 --> 00:00:28,540 And we're actually gonna cover, firstly, 11 00:00:28,540 --> 00:00:31,170 the Constraint Layout and this was introduced 12 00:00:31,170 --> 00:00:35,510 in Android Studio 2.2 and it's much more efficient 13 00:00:35,510 --> 00:00:37,820 than the previous approach of having to 14 00:00:37,820 --> 00:00:41,150 nest layouts to create your app's screens. 15 00:00:41,150 --> 00:00:42,250 Now, although it was introduced 16 00:00:42,250 --> 00:00:45,080 when Nougat was released, Android N, 17 00:00:45,080 --> 00:00:47,130 Google have made sure that it's compatible 18 00:00:47,130 --> 00:00:50,060 with all API levels way back to Gingerbread, 19 00:00:50,060 --> 00:00:51,930 and that's API 9. 20 00:00:51,930 --> 00:00:54,780 Secondly, we're going to look at views. 21 00:00:54,780 --> 00:00:56,510 Now, every widget you place on the screen 22 00:00:56,510 --> 00:00:58,950 is actually a View in Android 23 00:00:58,950 --> 00:01:02,680 and widgets, by the way, are the various components 24 00:01:02,680 --> 00:01:04,780 that make up a useful Android screen. 25 00:01:04,780 --> 00:01:07,680 Things like buttons, text boxes, sliders, 26 00:01:07,680 --> 00:01:09,160 they're all views. 27 00:01:09,160 --> 00:01:12,180 Now, it's possibly a strange use of the word view, 28 00:01:12,180 --> 00:01:14,900 but that's what Android calls them. 29 00:01:14,900 --> 00:01:17,325 Third, we're going to look at Android events. 30 00:01:17,325 --> 00:01:19,740 Now, when we want a button to do something, 31 00:01:19,740 --> 00:01:23,440 we have to write code that responds to an event. 32 00:01:23,440 --> 00:01:25,190 Now, in this case the event is the user 33 00:01:25,190 --> 00:01:28,560 tapping the button, so we'll see how that's done. 34 00:01:28,560 --> 00:01:31,910 We're also gonna look at writing code in Android Studio. 35 00:01:31,910 --> 00:01:34,870 Now, we can't do much at all without creating some code, 36 00:01:34,870 --> 00:01:36,380 so this section will introduce writing 37 00:01:36,380 --> 00:01:39,140 Kotlin code in Android Studio. 38 00:01:39,140 --> 00:01:40,670 We're also gonna look at Activities, 39 00:01:40,670 --> 00:01:43,080 as well as the Activity Lifecycle. 40 00:01:43,080 --> 00:01:46,420 Now, Activities are an important concept in Android 41 00:01:46,420 --> 00:01:48,470 so I'm gonna be explaining what they are 42 00:01:48,470 --> 00:01:51,800 and discussing their lifecycle when an app is running. 43 00:01:51,800 --> 00:01:54,330 You'll also see that Android destroys your screens 44 00:01:54,330 --> 00:01:55,770 when you do something like rotating 45 00:01:55,770 --> 00:01:58,430 the phone from Portrait into Landscape. 46 00:01:58,430 --> 00:02:00,460 It stops your code and completely removes 47 00:02:00,460 --> 00:02:02,700 the entire Activity from memory. 48 00:02:02,700 --> 00:02:04,240 Now, that sounds a bit drastic, 49 00:02:04,240 --> 00:02:05,670 but we'll be looking at how Android 50 00:02:05,670 --> 00:02:08,089 allows us to cope with that situation 51 00:02:08,089 --> 00:02:10,400 and it happens when you use most apps 52 00:02:10,400 --> 00:02:13,400 and it isn't something that users are generally aware of. 53 00:02:13,400 --> 00:02:15,210 Alright, we're gonna start by showing 54 00:02:15,210 --> 00:02:18,270 now how to use the designer in Android Studio 55 00:02:18,270 --> 00:02:20,610 to create the screens for our app. 56 00:02:20,610 --> 00:02:22,000 And we'll have a play with it to get used 57 00:02:22,000 --> 00:02:24,500 to how it works and what we can do with it. 58 00:02:24,500 --> 00:02:26,850 So let's get started on that in the next video.