0 1 00:00:12,300 --> 00:00:16,050 Let's start by opening Android Studio and start a new project 1 2 00:00:18,580 --> 00:00:28,670 select all the default settings in plain app with an activity let's give it some time to start so 2 3 00:00:28,680 --> 00:00:32,880 once we generate a new project we will see some processes running in the background. 3 4 00:00:34,430 --> 00:00:42,260 These are related to Gradle. Gradle is the build system on the Android Studio. You have all the build 4 5 00:00:42,260 --> 00:00:49,640 properties in your gradle properties file, here you can include libraries from repositories and once 5 6 00:00:49,640 --> 00:00:54,470 you update the code the project will start building these gradle scripts and download whatever is 6 7 00:00:54,470 --> 00:00:59,870 included in them if it's the first time you're ever doing this it might take a while 7 8 00:01:02,830 --> 00:01:07,780 so let's just have a quick look at what is included in the application. 8 9 00:01:07,980 --> 00:01:15,350 So this is just an out of the box hello world application right we can see over here is the main activity 9 10 00:01:15,410 --> 00:01:22,130 which is created by default let's have a look inside. 10 11 00:01:22,360 --> 00:01:28,600 Next we have the layout of an application in our activity we point to a layout which is where we have 11 12 00:01:28,600 --> 00:01:36,020 the user interface another important file is the android manifest. 12 13 00:01:36,220 --> 00:01:42,350 Think of it as a file that explains the main features of an app to the Android operating system. 13 14 00:01:42,380 --> 00:01:46,640 Here we will define all app components and permissions that an app uses. 14 15 00:01:49,850 --> 00:01:56,550 Android wants to know in advance what the components in an application are so it goes to the Android 15 16 00:01:56,550 --> 00:02:02,220 manifest file and all the components will be defined within the manifest. 16 17 00:02:02,290 --> 00:02:04,320 There are different types of components. 17 18 00:02:04,480 --> 00:02:11,760 The idea of this section is to develop an app that makes use of all of these components another important 18 19 00:02:11,760 --> 00:02:18,900 thing defined in the manifest is the permissions. So for example say we want to make an application that 19 20 00:02:18,900 --> 00:02:22,360 can send S M S's. OK. 20 21 00:02:22,380 --> 00:02:24,750 You can write the code inside your activity. 21 22 00:02:28,350 --> 00:02:34,950 So say you go to your activity and write telephony manager dot send sms or something along those 22 23 00:02:34,950 --> 00:02:37,390 lines. 23 24 00:02:37,430 --> 00:02:41,500 This will not work unless we define the permission over here in the manifest. 24 25 00:02:41,510 --> 00:02:47,970 Saying this app can send sms. We'll show you how to do that later on in the course. 25 26 00:02:50,060 --> 00:02:50,350 OK. 26 27 00:02:50,390 --> 00:02:56,680 So we have the activity, the layout and the manifest. 27 28 00:02:56,690 --> 00:03:04,810 We also have the resources directory. Any resources that are to be included in the app be it xml files, 28 29 00:03:04,810 --> 00:03:11,840 strings or images, you should be placed in the resources directory. 29 30 00:03:11,880 --> 00:03:16,650 So for example under resources and values we have a file called strings. 30 31 00:03:16,650 --> 00:03:22,580 And this is where we would put all the strings that we refer to in the application. 31 32 00:03:22,590 --> 00:03:28,290 So for example say there's an app title that we want to refer to in different places in the application 32 33 00:03:30,230 --> 00:03:31,420 we'll define a string. 33 34 00:03:31,430 --> 00:03:42,810 Call it my title and then we can just refer to it across the application by using string slash my title. 34 35 00:03:42,840 --> 00:03:50,650 This is just used to keep everything consistent throughout the application similarly we have styles 35 36 00:03:50,830 --> 00:03:51,850 over here. 36 37 00:03:51,850 --> 00:03:58,670 So say for example in your app you don't want to show the taskbar or the action bar at the top then 37 38 00:03:58,670 --> 00:04:04,980 you can remove it from the style and every layout referring to this style will make use of it. 38 39 00:04:05,000 --> 00:04:08,530 So what else. OK. 39 40 00:04:08,540 --> 00:04:13,110 So the layout of the user interface that's associated with an activity. 40 41 00:04:13,160 --> 00:04:18,290 So here we see that by default it creates an activity called main activity. 41 42 00:04:18,290 --> 00:04:26,080 And the main activity sets the content to the activity underscore main layout and if we go on activity 42 43 00:04:26,080 --> 00:04:32,430 main layout we'll see that this is the user interface that's created by default. 43 44 00:04:32,520 --> 00:04:40,570 We'll be looking at these user interfaces later on in the course. Drawables, here we can put any images. 44 45 00:04:40,570 --> 00:04:49,180 So for example by default you get the android logo as an image, so if for example you have your own logo 45 46 00:04:49,450 --> 00:04:57,000 you upload it over here and change the reference then all logos will be changed to yours. So that's our 46 47 00:04:57,000 --> 00:04:58,980 default application out of the box.