Android App Development
The course is part of this learning path
This course will introduce you to Android app development, get you set up with the correct development environments, and begin introducing the basics of the Android system.
This course is ideal for anyone who wants to learn how to use Kotlin for developing applications on Android.
This content will take you from a beginner to a proficient user of Kotlin and so no prior experience with the programming language is required. It would, however, be beneficial to have some development experience in general.
Alright. Well, hello everyone. I'm going to give you some information about the Gradle Build System in this video. But before we start, I want to show you Gradle files on Android Studio. So, let's go to Android Studio right now. Alright, so, you can see the Gradle files on the left side and there are two important gradle files for us in that level. These are the build.gradle(Project:My_Android_Project) file and the build.gradle(Module:My_Android_Project.app) file. Now, before we get into those files, I do want to say a little something about Gradle.
Gradle is basically a building system that automates the build of android application development. Gradle makes testing, building, debugging and releasing a whole lot easier. Gradle also makes it easier to add new libraries to our project in Android Studio. So, the first page here, build.gradle, my first application page is about which version of the Gradle system. So, the Gradle version here may be different for you, it doesn't really matter. The important thing is to know what Gradle version that you have and that it is here. Also, if you notice the line where the Gradle version is shown by the code editor is highlighted in bold. Well, that's because there is a new Gradle version and we need to update a Gradle version as well. Now, there is a place that asks you to update when you open any project in Android Studio. Just make sure to do this update, my friends, before you start work, okay? You've got to always work with up to date libraries. It's just better that way, all right. So, in order to do that just follow me, I'll move my cursor over the line that needs to be updated. Current version is automatically shown to us by the code editor. Then from here I'll click the 'change to 7.0.1' expression. As you can see, the Gradle version has now changed, but we do need to report this action to our entire project. Okay, very important. So, notice here when we made this change, the Sync Now button appears in the upper right corner of the interface. So, by clicking this button, we actually synchronize a change we made with our project. Al right, I probably heard some of you thinking, "Well, hey, what's going to happen to me if I don't click the 'Sync Now' button?",
all the changes aren't going to be detected by your project and that's going to be a problem later.
So, I'll just press the 'Sync Now' button. And as you can see, the synchronization process starts up and synchronization is pretty much a short process. It generally completes in 5 to 10 seconds. And as you can see here, the synchronization process is now finished. So, now our Gradle version is up to date and now, let's have a look at the other Gradle file. So, the most important page for us here, for now, is the build.gradle module app page. This page is about our application and its features. You can see some values here and I'll just take a minute to explain these values and what they mean. So, have a look at the first one. It's compileSdk version. Alright, so, this value determines which API level features we can use. For example, if this value is 25, we will not be able to use API 28 level features, right? You see how that works. If this API level is higher than our application, we'll have some more of these advanced features. Now, the second one is the applicationId. So, this is a unique value, right? So, for this application, this particular one com.example.myandroidproject. So, when we upload this application on Google Play, it will be known by this Id in Google Play. The third one is the minSdk version. So, this value determines which API level and above can work in our application. All right, tends to be a lower value. So, for this application, it is 23. So, that means that this application will not work with API level 21 and lower. And the other one is the targetSdk version. So, this value indicates that my application works well at this API level. We should also give the minSdk value as, well, you know what? Let's just make it as small as possible and the compileSdk also pretty much as big as possible, right? Also, the compileSdk and the targetSdk needs to be the same value. Now here's another value. It's versionCode and you're going to see this code when you publish your application on Google Play. Now it has to be integer values: 1, 2, 3, etc. it continues. After you publish your application on Google Play, if you change something in your app and you want to upload your new version, you must increase this value. Otherwise Google Play will not accept your new version of the application. Now, the version name is of course when people want to update the app on their phone, they will see this value. It's kind of unimportant actually for Google Play, but people will see this value. So, that makes it important.
It can be 1.0, 1.1 and goes up from there. So, when you update your app, you should give a new version name for the people who are actually downloading your app. That makes sense. So, when you change the value in Gradle, you're going to see the Sync Now button. So, after you click this button, it's going to change everything to the new values. Alright, cool. So, lastly we do need to talk about dependencies.
Now, this part in Gradle is for libraries. If you want to add a new library to your project, you're going to use this part. So, Android Studio and Gradle make it very easy to add new libraries. But before Android Studio, it was not so easy. Now, you just add the library codependency section and click the 'Sync Now' button and bada boom, you're done. Now after that, everything about that library will be added to your project automatically. How great is that? So my friends, I think that's enough talk about Gradle for now. Why don't we just take a short break here and I'll see you in the next video.
Mehmet graduated from the Electrical & Electronics Engineering Department of the Turkish Military Academy in 2014 and then worked in the Turkish Armed Forces for four years. Later, he decided to become an instructor to share what he knew about programming with his students. He’s currently an Android instructor, is married, and has a daughter.