Section 2 - Introduction To Android Studio
Android Studio Over View:
Lets start, Android studio is a software that you need for in this course. its made my google. it includes both a development environment and a simulator so you can actually see the result of your apps building right there on your machine.its easier then ever to install and does not require any extra software to run unlike previous fashion of an Android studio.just go to
https://developer.android.com/studio/index.html?gclid=Cj0KCQiAlpDQBRDmARIsAAW6-DMeG1bUCFYzgEl3VWI2_RCQNGBDlwx75L9eqbl3ZL_n3dzaFsLHHVQaAuTwEALw_wcB
and click the nice big green Button download Android Studio button
after downloading open the file and install it
Now create our first Android Project
start a new project
you can change the application name like (Demo App)
you can also change the company name or domain name. company name or domain name does not matter much at this point.
the only really importance of the company name here is that the package name would be created from that company domain.The package name is used when you submitting your app to Google Play. The unique way to referencing your app so has to be completed unique but you can change it anytime now click next
Again click next
now select Empty Activity and click next
click finish
now click on top left on project
there are two options one is app(Selection of folders and files that make up of our app) and other is Gradle Scripts(gradle is an open source build tool which is usually Android studio used to build you apps from these folders and files if we want to we add some scripts to do some custom work in the build process )
now double click on the app folder you can see three folders in that the first is manifests and in the manifests file we get the single file AndroidManifest.xml
we do not worry to much for the code All we know to need this point.Android Manifest contains basic details of our app so just the icon, label, app name then the app theme etc. we edit this later on but for now we just leave it as default.
At the bottom there is our res folder for resources and there we put things like icon , images that we use in our app or music if our app needs.
finally then the middle folder java is where the real meet our app lies and specifically we ignore the two test folders for the moment and in that first folder we double click and then click our MainActivity and this is the main file where the code of our app is run so this is your first taste of java but it looks quite scary don't worry it will be second nature in just a few tutorials time. we have a quick summary whats going on here essentially we defining the package.
if we click on three dots here we importing two classes or essential a bundle of codes that will allow our app to work or we importing many more classes later on the course but for the now we just got the default two the first is AppCompatActivity, essentially this make sure our app is back ward compatible with as many older versions of android as possible and then we just got the operating system bundle that allow us to work with the android operating system
and then finally here we creating a class called MainActivity which will allow us to work with the Activity we created so remember the screen will display the uses
left hand side you see the various user interfaces elements that we can drag in to over app...we have some layouts that show on the left side of the screen we will look out all of that later on our course and also see the Widgets things like textview , edittext , buttons etc
so on the top right side the you see the Device Screen and in that we got a RelativeLayout which essentially means that everything is laid out relative to whats around it so if we add a second textview beneath the tinny hello world one that would be display relative to the first one and finally at the bottom we got properties which would very dependent on element that you selected and here is huge range of properties can use to customize in each individual element.
we work on two main activity files one is activity_main.xml file and other is MainActivity of java file.
Now click on the green play button to see the Demo App in action
and this will allow us to run over app either on emulator on my computer or an a android device to attach to over computer by a usb.
Congratulation you run your first app
Customizing Text View:
double click on Hello World! here you can change the text and change the id if you want to...
now we add another text in to over app.Click on the Plain TextView and drag in to your app where you want to show the other text



















Comments
Post a Comment