Hello this is Martha's Dockerty.
And in this story we're going to start creating our first Android studio project.
So in order to create an android studio project you just need to click on this option here that says
Sard.
And you and it's true to your project.
And here we need to specify the application name.
So the application name can be.
Hello and hi.
Where is the name of the application application.
Can't specify the company domain.
So the company domain is used to generate a unique package name to a unique package name is actually
your the identifier of your application in the Google Play Store.
Generally we use a reverse domain names.
So instead of this domain that are used as a site that that example that come of use Come dot for example
whatever value what ever value you got for example another value for example my name write be used diverse
domain names for our company.
And as you can see here as I change the name the value of this company Ptomaine the package name is
also changed.
So you can see this value here MOTSS up that whatever value that come up that hello.
And Hollywood this is a unique package name a unique identifier for our application in the Google place.
So it must be unique.
Make sure to choose a unique value for the package name.
And if you want to you can edit this package by just clicking on this.
It is put in here at the right hand side.
We have also this project location so if you want to you can change the location of your project inside
your computer.
And we have these two options include C++ support and include courtliness support.
So we do not want to add C++ or Cawthorne into our project.
We want to use Java to our in our projects so don't chase these checkboxes here.
Just click on next here.
It says Target Android devices select the form factors and minimal the.
First let me tell you that we are not going to create Android Wear TV or adult or tool or Android things
applications we are just going to only target phone and tablet in discourse and here and here we can
specify the minimum STK that your application can run.
What is the minimum STK.
So for example it may choose API or 16 Android 4.1 developing.
If we choose this option its as by targeting API 16 and later as the minimum SDK it your app will run
on approximately ninety nine point two percent of devices that are actually live in Google place thought
the minimal SDK is going to specify the minimum operating system that the minimal version of the Android
operating system that can run your app.
So here we say for example Android 4.1 gelatine is going to be the minimum STK.
So here you can also check this checkbox that says include Android instant apps aport So check this
checkbox.
You can actually just enable this option later.
For now just do not check that check box and just click on next.
Here we have some activities.
So lets choose basic activity for this application because this is basic activity it comes up with a
menu option and a floating action button already.
But these are just templates and we can for example add if you choose for example interactivity you
can add for example menu options or floating action button to your activity.
You can add maps logging activity or lots of other features.
For example navigation Troyer scroll scrolling activity settings activity and lots of other tablets.
These are just templates that you can start your app with.
You dont have to choose for example a specific activity but if your app for example starts with a map
Google Maps activity you can use this template.
But for analysis basic activity here that comes with our menu option and the floating action button
and just click next.
Here we have some other options.
It says create a new basic activity that app bar so app part is at the top here you can see it comes
to be dispatched button menu option.
So here for example it says activity name so I'll talk more about activity names.
For now you may not know about activities or layouts or for example the title for now just leave these
values as default and also we are not going to use fragment in this application so do not checkbox.
Check this checkbox.
Just leave these values as default you are going to master these concepts later in this course and just
click on finish in order to create our first Android studio project.
So now that our project is created you can see this tip of the dialog that opens so it can actually
teach you something about the I-T integrated development environment.
Here we can learn something.
If you just can actually close this dialog.
So now our project is created.
We have lots of things here at the left hand side.
We have the Android view.
We have the palette section.
We have to lay out at the right hand side we have the attributes section so we are going to learn all
about these things later in this course.
But for now I'm going to just introduce you to these components that make the android app.
So first let's talk about this site but at the left we have this android view.
So for you it may not be Android view.
And if you want to actually open Deandra view you can see these two little triangles here.
If I click on it we have the surprise at the packages scratches and.
You should always choose Android If you want to actually create Android apps because it can actually
show you their files and the packages that are required that you need to actually manipulate.
If you want to create your your specific Android app.
So for example if you open this app for their behalf this manifests.
So if you open this manifest we have this android manifest that them all white.
So let me double click on this fight and manifest.
And here now you can see this tab is opened.
Let me double click on this tab in order to make this area wider so the manifest file is going to contain
some general information about your application.
So we have this application tag and inside the stack for example we have some attributes that you're
going to learn later but for now let me talk about some of them.
For example this I can attribute the attribute is going to specify the icon of the application that
is run on the user's device.
So for example I'm going to teach you later how you can run your app on an emulator but for now let
me run the app because I have already created one emulator so for now you don't have to worry about
the emulator later you are going to learn how to create your own emulator.
But for now let me show you that when it says luncher or icon you can see that it means this icon here
is going to create a default icon for you and it can just put it as the icon of your application.
So this is our application running on this emulator here at the top.
You can see this.
Hello and hi world takes at the right hand side.
We have this menu option and we have this hello world at the center and we have also this floating in
action button here at the bottom.
So we are going to learn more about this floating nation button later.
But for now let's just go back to our studio to our manifest fight.
We have this label attribute right the label attribute that is going to actually to refer to our name
inside strings that exemplified.
So you're going to learn more about these things that exemplified don't Vody so we can see this.
Hello and Heibel here.
So this is the value label right.
We have the round icons so if you take a look at the icons here you can see that the icons are rounded.
So that's because of this attribute here we have supports RTL attributes so support 3L means support
right to left languages.
So we just it automatically by default.
The value is true.
You're going to learn how to translate your applications to other languages later in discourse.
So this feature is very good.
This attribute is really helpful.
And here we have this theme.
So the FEMA attribute is going to specify the style of your app and the theme of your app later in this
course.
But again you're going to learn more about all about actually themes in Android and how to use Android
material design in your applications.
If you have this activity tag so the activity tag is going to for every activity that you have inside
your application there must be an activity declared inside the Android manifest that is modified.
So an application only has the one activity.
So let me open it.
It is only one activity.
But and again see that one activity tag is actually created inside the average manifested exemplified.
And these are the attributes of our activities So for example the name of the activity is that main
activity starts main activity the first to the package name of the activity that this main activity
actually exists.
So let me show you the Android view if you want to open the Android view at the top here.
He just lets you click on View tool windows and then click on Project.
OK.
So at the left hand side you can see that we have this job of all that and this is the name of the package.
Right.
And inside this package we have the main activity file.
If you open it you can see this me and humidified.
So it's going to it is actually referring to this name of the package that main activity the main activity
is actually inside this package.
We have the label of the activity right.
And we have also the fien the this time we have this intent filter tag.
So because our main activity is going to be the lantern activity it is this task is created for this
activity.
It is the main and lot activity you're going to learn more about this later.
For now I just turned 40 and it just wanted to introduce you to the Ad-Rock manifested decimal.
So let me close this and with manifested example fine.
So are the left hand side.
We have this again Jawa folder inside the subfolder we have this package that is going to contain all
of our actually java files.
So we only have one activity on top of the main activity.
So I just cannot have that we can be you know to make this area wider so we can see that these are the
Java codes for now.
If you don't know anything about Java Don't worry you're going to master Java programming.
Lagering discourse.
And here you can see for example the uncreate.
Is this is actually one of the Amlet lifecycle methods and some other methods that you're going to learn
more about later.
So let's close this profile.
Let me close with this example.
So here we have two other packages that are not going to work with.
So let's just close these packets here.
And here we have this race folder.
So this is really important.
The first folder that you can see here is the tribal folder the dreidel for that is going to contain
all of the images that and resources that you're going to use inside that application and you are going
to copy and paste or images inside this job tribal folder.
And here we have this layout folder the layout where that is going to contain the main layouts.
And for example there are literally outs that are going to be related to our activities inside our project.
So if we have this activity under a limited example and we have this content on the last minute segment
so now you may ask that we have only one activity void we have to separate out the activity and the
content and that's because we have chosen the basic activity.
When I when we wanted to actually specify the templates the initial template of our application.
So here we have the activity under Lemnitzer similis actually open this file.
Let me double click on the slab in order to make this area wider.
So here in this activity if I click on it as you can see I cannot interact with this hello world view
by which I can see for example interact with this but the have all this action here at the bottom at
the bottom here we have two taps the Design tab and the text that if I switch to the text that you can
see that we have the coordinator a out as the parents lay out.
So these are the actual codes.
And here we have some other tasks here.
But here I want to show you that what every kid that you put inside the XML file is going in it's going
to be reflected in say this Design tab and about the work that you put inside this Design tab is going
to be reflected inside these XML codes.
This means that the Design tab and the text up are actually interrelated.
So for example we have these a floating action button tag here inside this XML file.
So this is actually the codes that have created the floating action button here inside this design.
Having said this earlier let me switch to the text that now at the right hand side you can see this
preview if you click on it you can see the preview of the layout.
And here are the example codes.
Then I select this tag.
You can see that there the inside this preview the fluting action button is actually selected right.
Or for example if I select the frozen action button inside this preview it's going to highlight the
floating action but intact.
So now let's highlight the floating action but attack and let's delete the stack and you can see that
the action button is actually also deleted inside is left right.
So if I undo my action now the floating action button is back right.
So here this activity is activity on the no minute segment actually contains the cult content underlining
that.
Because of this tag it says include lay out and we have two codes at sign out.
It is referring to the layout slash content underly minute example.
So when it says at layout it is referring to the ATS to the layout folder.
So let me read and review.
I just use the shortcut.
So if you want to learn what is the shortcut you can see at the top you just need to click on view to
Windows.
And here we have this project and here it is the shortcut formalities command the one for Windows.
I think it is a control one.
So here you can see that we have activity on eliminativism ad and content underlayment that examine
inside this layout folder.
So then it says at sign the out it is referring to this layout folder.
And here it is actually including the content underlayment that examen exemplified.
So this activity underly I mean an example actually includes the content on the I in that example you
can see some other attacks or you're going to learn more about it later.
So for example we have this toolbar that we offered to preview if I select it to anybody can see this
toolbar that is actually selected here.
We have this app bar layout that actually contains the toolbar.
So this app really out is the parent of this toolbar.
You're going to more about learn more about this later in this course.
So let me close this preview.
And here let's go inside this content underlayment an example that we had the hand is that you know
there's this area right there and here you can see inside this content the minute exam and we cannot
interact with this floating action button but because this a floating action pattern is declared inside
the activity other than the underlying.
I mean are they similar.
Right.
So now we have this hello world.
We can interact with this hello world.
We can select the hello world and then press ideality on our keyboard.
But here in this course first we are going to master relatively out and linearly else and our course
is already created with our constraints laid out so you can see at the bottom left hand side we have
this componentry section right.
This componentry section is going to specify the hierarchy of views that are inside your layout.
So here we have the constraint lay out as the root lay out.
We don't want this to happen.
So whenever we create and write applications in the scores especially at the beginning of the scores
you can see that the insert is componentry the relative lay out is actually the lay out in order to
change the constraints out to relatively out you need to just switch to the text.
And here it says and do it that supports the constraints that constraints lead to highlight disvalue
here and just type in here relatively out with capital R.
So as you can see as I'm typing relatively out the ending tag of this route lay out is also changing.
So I'm just going to say that it's relatively out and then press and enter key on your keyboard.
So now the route lay out is going to be relatively out and here is relatively out now contains this
text.
So let's switch to that is right.
Now you can see this hello world view is at the top left hand corner of this play out.
OK.
So here you can see that we have this pallet section.
So this pallet section contains the components the user interface components that you are going to actually
add to our layout.
So for example we have the spotted we can add a button to our related relatively out here.
You're going to learn more about relatively out later in this course.
Phone I just thought very relatively out means positioning items in relative to each other.
OK.
So here for example we have this toggle button checkbox radio button checked text view and lots of other
components that you're going to use later.
But for now you have this pallet all you can click on widgets in order to see less components.
We have text.
So for example if you want to add a takes you to your layout you just need to select Stacey and just
drag it here into our into your relatively out.
So here to say that it takes you on the right hand side we have these attributes that are related to
the state's view.
We have the ID the ID is used so that whenever we want to interact with this takes you from our job
of course we are going to revert to this.
So the idea is very important.
We have to lay out with the lay out height the lay out what it is.
It is going to specify the Veach it takes you out.
So for example currently it is raw content rap content means and wrapping around the content of this
layout so the text view is actually layout right.
And when we say wrap content it is going to wrap around the content the content is the text inside this
text view here.
So we can also change it to match parent.
Right now the text view lay out with is match parent parent refers to the parent of this takes you inside
this component resection.
You can see the hierarchy of views.
So we have this takes you inside is relatively out.
This means this relatively new out is the parent of this view and this this is the child of this relatively
out.
So then it's as much a parent as they lay out which of these text view.
This means the veto of this takes you is going to be matched to the beat of the parent which is this
relatively out.
But you can see there is still some space here and because this attribute is now conflicting with other
attributes.
So you're going to master a master relatively later in this course for now just on 40.
We have this lay out high.
You can also change the raw content to match parent.
Right.
You can see now the height is much larger or even just hard code the value of totally out.
So for example you can say a 50 DP.
OK.
So this DP is very important what is this DP.
DP stands for density independent pixels which is the android way in order to specify that how your
widget is going to look like in other in lots of different Android devices because lots of different
Android devices comes with different resolutions and qualities and screen qualities actually.
So this DP is used for specifying how quality How are these tapes view is going to be shown on on a
specific device with a specific quality.
So let me show you a posting a stack overflow.
Here you can see it says from the average level of documentation pixels corresponds to actual pixels
on the screen in inches based on the physical size of the screen.
We have a millimeter of space and the physical side of the screen.
We have P-T points.
And here we have the p or the IP density independent pixels and abstracts unit that is based on the
physical density of the screen.
These units are relative to.
One hundred and sixty DP screen.
So one DP is one pixel on a 160 DP sclayn the ratio of DP to pixel will change with screen density.
So this is very important but not necessarily in direct proportion not the compiler accepts both the
IP and DP Do DP is more consistent with Espey so espie is also scale independent because we use SPF
if you want to actually specify the text size of a specific text view.
So scale independently so this is like the DP you need but it is also scaled by the users font size
so users.
So we use this as p for the font size preference.
It is recommended you use this unit when you're specifying font sizes so they will be adjusted for both
the screen density and the user's preference.
OK.
Add on other articles that I want you to read now is supporting multiple screens.
So let me show you that article.
So here it is the article in Google you can just search for these these keywords here supporting multiple
screens.
And then you will see a link that will guide you to this page or you can just directly enter this you
are inside the search bar of your web browser developer and Twitter.com slash guide slash practices
slash screens Otherland supporter.
Well I just want you to just read this documentation.
We're going to learn more about this later.
But for now I just want to read this document is this documentation in order to introduce yourself to
how Android actually handles multiple screens.
OK.
So let's go back to android studio.
So here it is R-TX view on the right hand side we can see these attributes.
For example we can change the text or text you can see hybrid right and that person until Genner keyboard
and here are inside this pallet section.
We have some other components inside these ticks.
We have plain text or plain text is different from the text view.
So if I select this plain text and just added into a layout you can see that it is actually an edit
text instead of a text view.
So and a text is actually a container for text we can enter a text inside is editor.
And at the right hand side you can see these attributes.
So for example we have the hint attribute here right.
We can say enter enter a name and then dot dot dot and then put it on until you can your keyboard and
just delete the text value of this text attribute and the person and it on your keyboard.
So here you can see it says enter a name.
So in this case we can enter the value let me run the app let me show you the emulator.
So here it is our app running on the simulator.
And here if I click on it it takes you can see that I can just type the value inside is added text.
Right.
So for example it says Enter the name so we can't just say Mac book right or we can say for example
Galaxie
So here this is how it takes work in Android.
We have some other Edhi texts we have to pass for added text which you can actually to enter a password.
So let me just drag a password it takes here and here let's run the app.
So here we can see our text.
And as you can see whatever I put here is shown as actually That's right.
So this is how we can actually use it as a passport that it takes and we have lots of other editrix
we have passed for numeric.
You can actually only enter numeric values.
We have it we have email forne postal address and lots of other components.
We have to lay out the layouts.
We have a lot of other layouts we have the constraint lay out grittily out of frame lay out linearly
out linearly as vertical.
We're going to learn all about these layouts here in this course.
We have the containers we have the contentless collection containers.
We have the radio group list view view expandable view scroll view horizontally scroll view.
So this one the default scroll view is actually the vertical scroll.
We have the tab host view search view and here we have these images.
Image button image view video view.
OK we're going to use these components later in this course.
And here what is that image view is actually a container for an image or this image button.
Right.
Or this video you.
These are just containers.
We have the date we have transitions at.
So you can see some of these components inside these advanced google and view map view design.
So here we have cordoned literally out of partly out tabouli out faluting action button and compact
here.
So our compact is actually related to how our application is going to be compatible with the older version
of Android operating system.
So we use this library a lot in this course and that's it.
It's enough for the story in the next story or we are going to learn more about layouts in Android.
So if you have any questions please post a discussion in the course and then I'll do my best to answer
all of your questions.
Thank you very much for watching.
And I look forward to seeing you in the next tutorial.