Okay, you've got Android Studio up and running, awesome work.
Now, you're going to participate in an important programming tradition.
Making a hello world app.
This is the basically the first step towards becoming an Android developer.
And at the end of the lesson, you're going to take this hello world app and
you're going to change it into the birthday card app.
So, you might be wondering what exactly is a hello world program.
Well, typically in programming languages,
one of the easiest things you could do is print out some words to the screen.
So therefore, usually the first program that will make it in a programming
language is a program that will do exactly that.
Print some words out to the screen.
It's kind of like when you're studying a new human language, how you learn words
like thank you or please or excuse me where's the bathroom?
A sort of your first building blocks of that language.
Okay, let's build the hello world app.
A quick note before we get started.
This video was recorded April 6, 2015.
Now, my suggestion to you is that you don't follow along with the video.
Instead, go ahead and watch the video through once.
After you're done with that,
we've provided some text instructions on the instructor notes.
From time to time, Android Studio is updated, which means that menus or
screens can look a little bit different.
And while the video might be out of date,
the text instructions will be updated a lot more regularly.
Okay, so, if you've closed Android Studio, go ahead and
reopen Android Studio.
You should be starting at this screen.
I'm going to go ahead and click on this aptly named,
start a new Android Studio Project button.
All right, that should take you to this screen,
where we have a couple of different options.
The first one is the application name.
This is the name that you'll see in the app bar at the top of the app
as well as the all app screen of the device.
Preemptively, I'm going to go ahead and they name this happy birthday.
Okay, right below this we have company domain.
And if this looks similar to a web address, you're right.
Normally if you owned a web address, you type it in here.
Now, at one point in my life I owned lylaujiwara.com.
So, if I was making an app for myself, instead of a demo app for
all of you, I will go ahead and change this to lylafujiwara.com.
Now, you might be wondering why.
Well, if I was planning to distribute my app on Google Play,
this package name down here is something that I need to uniquely identify my app.
Meaning, that across all of the people in the world who are making apps,
this needs to be completely unique.
Now, if we look a little bit more at the structure of this,
the package name is actually the company domain reversed.
So, instead of lylafujiwara.com, we have com.lylafujiwara.
Followed by the application name with no spaces.
So while there might be a couple of different app developers that make
a happy birthday app, you're not going to have a bunch of app developers
that all own lilafujiwara.com and are making a birthday card app.
And in the way that the Internet is set up, if I buy lylafujiwara.com,
that means I should have complete control over what is shown there and
nobody else can buy that domain name.
And if I own it and it's specific to me,
then, that helps ensure that this package name is completely unique.
So, I know that you only know about package names right now.
You might not know what a package is.
We'll talk about that more a little bit later.
But the thing that you just need to keep in mind right now is that a package
name needs to be unique so that Google Play and
your phone has a unique way to identify your application.
Okay, but you're not me and you don't own this domain.
And since we're all practicing together and
I want us all to have sort of the same set up for
this app, I'm going to change this to android.example.com.
And you should go ahead and use the same company domain name
because I know that some of you won't actually own website domains yourself.
Also, it will be back our code.
And if you look below, you should see that it says com.example.android.
Again, that's the reverse of Android example com.
And that it says happy birthday after it.
Okay, so the next thing that you can change is the project location.
This is where all the files that have to deal with your app
will be saved on your computer.
Now, usually Android Studio will create a folder for
your Android Studio projects.
And the default is to just put your app inside this folder.
And you can see that the name actually
matches the name of the folder that it will be in.
This is a pretty good default location, so unless you have any strong reason to
change it, I'd go ahead to just click next.
Okay, now this is a fun screen.
It let's us pick what phones and
devices that we're going to actually make our application for.
Now, you're making an app for a phone and a tablet.
And you're not trying to make an app for TV wear or glass.
So, we're going to leave these all unchecked.
The drop down right here shows us the version of the Android operating system
that our application will support.
We're going to go ahead and scroll up.
You can see that the first public and
widely used release of Android was called cupcake.
With this release,
Google started a convention where they would continue to go alphabetically.
But name each operating system off of desserts or sugary treats.
Cupcake was followed by donut and eclair.
And this is why you'll see words like ice cream sandwich, honeycomb, and
KitKat in the dropdown menu.
Now below this dropdown, you'll see this handy help me choose link.
This graph shows some helpful percentages of how many people who have
Android phones use the different operating system versions.
Looking at it, we can see that most users,
at least of the time of this recording, are using the deliciously named KitKat.
The percentages,
show the percentages of people in the world using Google Play who will be
able to use our app if we pick one of these as our minimum supported version.
So if you pick the newest version of the operating system,
which is Lollipop, at least at the time of this recording,
only users with new phones would be able to download your app.
And that would mean you'd only have about 0.1% of all of the phone users
actually able to download your app.
So you might be asking, why not make an app for
all phones by picking the oldest version of the operating system?
Here's a picture of the first commercially available Android phone.
The T-mobile G1,
which is also known outside the United States as the HTC Dream.
It was released in 2008 and ran Android 1.0.
Obviously a lot has changed since then.
For example, apps like Google Wallet, which let you pay for groceries with
the wave of your smartphone, require a Near Field Communication.
A Near Field Communication or NFC, was actually a type of hardware that didn't
make it into Android phones until 2010.
So if you're making an app that requires NFC,
there's no reason to even try supporting older phones like this
that are running older versions of the Android operating system.
Anyway, for the purposes of your app,
I want you to use API 15 which is ice cream sandwich.
This should work for about 90% of the phone users out there.
All right, go ahead and click next.
I want to interrupt here for an important update.
Since filming the original video,
the activity templates have actually been updated and changed.
So, your screens are going to look a little bit different than what you're
seeing in the video right now.
If you're using Android Studio Version 1.4 or newer,
you're going to see these screens instead.
And instead of selecting blank activity,
what I want you to do is select the empty activity template.
This will generate the correct files that will allow you to follow along with
the rest of the course.
On this screen, you're given a bunch of starting templates you can choose from.
Depending on what you're trying to make.
You're going to go ahead choose blank activity,
which is already selected, because it's the sublist one.
And I'm going to click Next.
Finally, this screen gives you the opportunities to name a couple of
different files that are going to be automatically generated for
your application.
As you'll soon see, an application is composed of all the picture files,
sound files, XML files, Java files, and more that are required to make the app.
Basically, there are a lot of files that work together to make your application.
We'll talk about this all soon.
For now, take a look at the layout name.
You've been working on XML layout files.
So this is the name of the file we'll be editing in just a little bit.
I'm actually not going to change any of these defaults.
So you can go ahead and click finish.
Now, depending on your computer speed,
it might take a moment to set everything up.
If you look down here,
you'll actually see a little loading circle as well as a loading bar.
And we can see a loading circle down here as well,
meaning that it's continuing to think about things.
So, take a break.
Go ahead, stretch.
And get some tea.
I mean coffee.