‫-: Hi.
‫Now you have seen a lot of Android and Java code
‫but in fact you don't know how to proceed
‫with Android development at all.
‫And this is perfectly normal
‫because we haven't gone into the Android development.
‫And this course is not for Android development
‫but rather it's for reverse engineering
‫and it's for mobile application security.
‫But in order to continue with reverse engineering
‫you should be able to comprehend
‫at least the basics of Android development as well
‫rather than just pure focusing on Java.
‫So around 10 minutes over here
‫we are going to try and teach you
‫the basics of the Android.
‫So if you open the developer.android.com
‫and you don't have to do that, by the way.
‫I'm just showing you this as a reference.
‫You will see that an Android app
‫is actually consisted of four components.
‫So this is Activities, Services, Broadcast receivers
‫and Content providers.
‫So Activities are piece of screens
‫that we, the user actually sees the content, okay?
‫This is how user interacts with the app.
‫This is the screen that user is seeing.
‫So we have worked with Activities
‫during the Android development section, right?
‫When you build a calculator, for example
‫you have worked with Activities.
‫And for the Services, actually
‫this is for running things in background,
‫like if you wanna download something from the internet
‫and if you don't want to block the user interface
‫so that user can still interact with the app,
‫you use Services.
‫So this downloads the data in the background.
‫User doesn't even see what's going on
‫but it's being done.
‫And for Broadcast receivers,
‫we use them in order to provide communication
‫between the other apps and our app
‫or between the activities with inside of our app.
‫Okay?
‫And last but not least,
‫Content providers is for providing content obviously.
‫And you use them for something
‫like getting contacts from phone book for example.
‫Okay?
‫Or if you want to create a database inside of your app
‫you can use a content provider in order to retrieve data
‫or work with data generally from the database.
‫So this are the general components of the app.
‫And Services, Broadcast receivers
‫and Content providers are not always there
‫but Activities are always there
‫because we need something
‫to be interacting with for the user, right?
‫So let me open an Android project
‫and just show you some kind of basic terms
‫and some kind of basic operations
‫so that you can comprehend all of these things better.
‫In fact, in this lecture
‫you don't have to do that with me.
‫You can just note it down
‫write it down so that you won't forget, okay?
‫I'm gonna create an empty activity.
‫And as you can see
‫there are a lot of other activities as well.
‫So we can create a full screen activity.
‫We can create a Google Maps activity, like a login activity.
‫And these are just themes.
‫So activities with some kind
‫of built in views that comes within.
‫But we are going to go with empty activity
‫because we don't need any other thing
‫like maps or some kind of login service.
‫So I'm going to name this Android 10 minutes, okay?
‫And 10 minutes start right now, not before.
‫So I'm gonna go for Java,
‫but in fact it's actually the same thing
‫with Kotlin as well
‫because in this lecture at least
‫we are going to learn the basics of Android development.
‫So the terms will be the same.
‫The usage will be the same.
‫But since you get to know the Java right now
‫I'm gonna go for Java
‫and I'm gonna go for API 22 3 for minimum level.
‫It really doesn't matter at this point,
‫but generally you want to make your app audience
‫as broad as possible.
‫So you may wanna go with API 19 or something like that
‫which is not too old
‫so that you can use the newer technology in your app
‫and you can actually reach much broader audience
‫in your Android app.
‫So here we go.
‫Here is our first app
‫and you know how it looks.
‫So let me close this down.
‫This is the coding section.
‫This is our main activity, which we write our codes in.
‫And also we have this layout as well,
‫which is where we do the design,
‫the user interface of our app.
‫So let me open this decoration
‫so that we can see the thing
‫which is called title bar, by the way.
‫So this is the title bar.
‫And as you can see, we see the title of our app.
‫So this is a text view.
‫So we can drag and drop views from the left hand side
‫and we don't even need that.
‫So let me delete this.
‫And let me bring in a new one
‫so that we would have an ID.
‫So over here you can drag
‫and drop as many as you want
‫like this button, okay?
‫And for some reason I cannot drop this.
‫Yep. Now this works.
‫So here you go.
‫Now I have a button
‫and I have a text view.
‫So I can bring in an image view
‫as well as like other views if I want.
‫Like I can choose any picture to display
‫inside of this image view.
‫Okay? So the ID is important.
‫Don't forget to give IDs
‫or control the IDs if they exist or not.
‫So as you can see
‫we have IDs for text views,
‫buttons, and image views.
‫So that that is how we connect our views
‫with our main activity.
‫And on the left hand side you see the Android manifest
‫which is a file containing our some kind
‫of general settings for the app.
‫Like we see the icon over here,
‫we see the title of the app
‫we see the activities like this main activity.
‫And if you see something like this
‫like a main and a launcher
‫it means that this is going to be launched first.
‫Okay?
‫So when a user opens this app
‫they will see main activity first.
‫Of course we can have multiple activities
‫inside of an app
‫and they will be all listed here.
‫We're gonna go and look into that later on.
‫So under gradle scripts you will see
‫some kind of build up gradle file, which is,
‫which again actually consists of our general settings
‫like minimum SDK version.
‫Remember we have chosen 23
‫and target SDK version is the SDK that we are building this
‫that we're targeting this, okay?
‫And over here, under dependencies
‫we see the libraries or tools that we use.
‫These are the external libraries
‫and it gets downloaded by the gradle
‫once you build the app, okay?
‫So if you add something over here
‫like a cloud server, like a fire base.
‫We're gonna see what a fire base is later on.
‫You have to use this.
‫And sometimes when you actually reverse engineer the app
‫this information can be seen
‫in the underwritten manifest as well
‫like a minimum SDK version or something.
‫Don't be surprised about that.
‫So under main activity, remember what we have
‫we have this on create,
‫and if we add another activity from here by right clicking.
‫Okay?
‫We can create as many as activities as we want
‫and they will have their own on create methods.
‫So remember what on create does.
‫It actually defines what's gonna happen
‫once this activity is created, right?
‫Now, if I write something over here under main activity 2
‫it will be done when main activity loads.
‫And if you go to Android Manifest
‫you will see the main activity is listed
‫on the Android manifest as well right now.
‫So all these services, content providers
‫and broadcast receivers as well as activities
‫should be listed in the Android manifest like this.
‫And again, like Java file, we also have Activity Main
‫and Activity Main 2 XMLs separately over here.
‫We do the design separately
‫with different XML files.
‫For example, I'm gonna drag
‫and drop this text we wrote here
‫and make it a little bit bigger
‫and then put it in the middle of the screen like this.
‫Okay? And I'm going to change the text.
‫And I'm gonna write something
‫like activity 2 or second activity
‫so that we can really understand where we are.
‫So let me make this central
‫and make it a little bit bigger.
‫Here we go.
‫Now it's looking good, right?
‫So if I click on this button Infer Constraints
‫it will add some constraints
‫and constraints are tools
‫that we use to define where this view will be located
‫on an average screen like this.
‫So we use constraints to define the location
‫of the view on the screen.
‫So don't forget to hit Infer Constraints button
‫or give manual constraints if you're watching this lecture
‫and practicing it at the same time.
‫So I'm gonna do this same thing for main activity as well.
‫I'm gonna infer the constraints like this
‫so that they will be in place
‫when we run and build this app.
‫So if you click on the button
‫and give some kind of on click method
‫like this button clicked
‫it will be required for you to come
‫over the main activity.java
‫and write button clicked methods.
‫Okay?
‫So you are gonna have to come up over here
‫and not under on create
‫but inside of main activity you can create a new method
‫and it has to be exactly the same
‫like you have written inside of the buttons
‫buttons on clicked methods, like this.
‫Button clicked.
‫And we're gonna use view view in order to specify
‫this will be called by view.
‫So if you come across something like that
‫you're gonna have to hit alt
‫and enter on your keyboard to import the classes.
‫So here you go.
‫Now I have written button clicked over here and there.
‫So it's going to be whatever I write over here
‫is going to be happening
‫when I actually click on the button.
‫So now I'm going to use something called intents.
‫So we use intents in order to specify where we wanna go
‫what we wanna do inside of our app.
‫For example, I can say whenever I click this button
‫I'm going to create a new intent.
‫And this intent will take me to from here
‫from main activity, okay?
‫We are gonna use the main activity context
‫with main activity dot this
‫and we are going to go to main,
‫main 2 activity dot class.
‫So when I'm going to,
‫when I press this button
‫when I click on this button
‫it will actually take me to main 2 activity dot class.
‫And I'm going to say Start activity intent
‫in order to make this happen.
‫So maybe don't understand fully of this
‫and you need a full underdevelopment course for that
‫obviously.
‫But just so you know, if you know an,
‫if you see an intent
‫it means that you are gonna go someplace
‫like you're gonna go to another activity.
‫Are you gonna go to, for example
‫gallery of the user to choose a picture or something.
‫You're gonna go some places.
‫So let me run this app
‫and we are going to click on the first activity button
‫and it will take us to this activity
‫where we will see activity 2 text view, right?
‫And we haven't written down anything
‫in the main 2 activity
‫because we don't need to write, right?
‫We don't want something to happen under on create method
‫in the main activity as well,
‫because we only want something to happen
‫once a button is clicked.
‫For example, if I write something over here,
‫it'll happen then we see the screen,
‫but I don't want that right now.
‫So whenever I click on this button,
‫it'll create the intent
‫and take me to the main 2 activity, right?
‫So let's do that.
‫Here we go.
‫Now we are inside of second activity.
‫And this is how it works actually.
‫Now you know the intent, you know the manifest
‫you know the gradle, at least you know the terms.
‫Of course, you don't have to comprehend everything.
‫Every coder here, this is not for Android development
‫as I said before, but you have to know the basics.
‫Like you have to know what an intent does.
‫You have to know what is a gradle
‫or what is a manifest.
‫And when you are done with your app,
‫if you're a developer you can come over here
‫and say Build APKs.
‫And this will create an APK file for you
‫which is the final product
‫of your Android development steps.
‫So this is like an EXE file in Windows.
‫So this is what happens
‫if you double click on them, it'll run
‫and on the phone or on the, or on any Android device
‫If you just one click on the APK file, it will run again.
‫So this is the final product.
‫And actually in the real world,
‫when developers are done with their development,
‫they generate this APK, they sign it.
‫Okay, we are gonna see how to sign it.
‫Actually, we have seen it
‫in the first backdoor section as well.
‫And then they upload it to the Google Play
‫or App Store in iOS.
‫So APK is the final product of Android development.
‫So that's it.
‫See you in the next lecture.