background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "How to Make an Android App for Beginners"

input logo icon
Video tags
|

Video tags

treehouse
technology
tech
learn
free
trial
online
teamtreehouse
education
html
swift
ios
android
java
python
ruby
programming
developer
designer
Treehouse
Team Treehouse
Web Design
Web Development
iOS
tutorial
how to
JavaScript
jQuery
Ruby
HTML
CSS
HTML5
CSS3
kotlin
coding
appdevelopment
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:00
[Music]
00:00:04
android development can be a great way
00:00:06
to turn your idea
00:00:07
into reality or start a promising career
00:00:10
as an app developer
00:00:11
and getting started is probably easier
00:00:13
than you think
00:00:14
these days android development is done
00:00:16
with a tool called android studio
00:00:19
android studio is kind of like the
00:00:21
microsoft word of writing android apps
00:00:23
it helps organize our projects and gives
00:00:25
us a user-friendly way
00:00:26
to create what we're looking for in this
00:00:29
video
00:00:30
we'll walk through installing android
00:00:31
studio and then make an app
00:00:34
don't worry if you don't have any
00:00:35
experience with android or even
00:00:37
programming in general
00:00:38
as long as you follow along we'll all
00:00:40
end up at the same place
00:00:42
now we'll download android studio in
00:00:44
just a second
00:00:45
but first let's look at what we'll be
00:00:47
making
00:00:48
these days there are too many choices of
00:00:51
everything
00:00:52
so to help us choose between a bunch of
00:00:54
options we'll make an app that lets us
00:00:56
specify
00:00:57
how many options there are and then
00:00:59
selects one at random when we click a
00:01:00
button
00:01:01
awesome now that we know where we'd like
00:01:03
to end up
00:01:04
let's start by downloading android
00:01:06
studio
00:01:08
click the link below to go to the
00:01:09
android developer website
00:01:11
and then click the download button
00:01:16
accept the terms and conditions and then
00:01:19
download android studio
00:01:22
once it's downloaded follow these steps
00:01:24
to install android studio
00:01:26
drag it into the applications folder and
00:01:29
then launch android studio
00:01:31
since you won't have any previous
00:01:33
settings you can choose do not import
00:01:35
settings then click ok to complete the
00:01:37
installation
00:01:39
and now we're presented with the android
00:01:41
studio setup wizard
00:01:42
on this first screen we can just click
00:01:44
next
00:01:45
for the install type let's pick custom
00:01:48
and then click next now we can pick our
00:01:52
ui theme
00:01:53
i'll keep it as default and then
00:01:56
when we're selecting our sdk components
00:01:59
i already have the android sdk installed
00:02:01
on my computer but you'll want to make
00:02:02
sure this is checked
00:02:04
as well as the intel hacksum performance
00:02:07
box
00:02:08
and since i'll be running this on a
00:02:09
virtual device
00:02:11
we'll want to include an android virtual
00:02:13
device as well this is just a version of
00:02:15
android that runs on our computer
00:02:17
if you have your own android device you
00:02:20
don't need to include this but it's
00:02:22
recommended if you're going to continue
00:02:23
doing android development
00:02:25
then let's click next and we can accept
00:02:28
the recommended choice here and click
00:02:29
next again
00:02:31
and then finish once you've downloaded
00:02:34
all the components you might need to
00:02:36
type in your password to allow it to
00:02:38
install hacksim
00:02:40
then let's click finish and now that
00:02:43
we're running android studio
00:02:45
let's pick start a new android studio
00:02:47
project to get started
00:02:50
first we'll need to specify our
00:02:51
application name
00:02:53
let's call it randomizer
00:02:56
then for the company domain you would
00:02:59
put the web address of your company
00:03:01
so for me this will be teamtreehouse.com
00:03:06
though really as long as you're not
00:03:08
publishing the app to the play store
00:03:10
this can be whatever you want lastly
00:03:13
android used to be written entirely in
00:03:15
java but recently
00:03:17
we've been given the freedom to use
00:03:19
kotlin which i think
00:03:21
is a big improvement over java let's
00:03:23
check the include kotlin support box
00:03:26
and then click next to continue
00:03:30
next again and then finish
00:03:37
now i know you're probably ready to get
00:03:38
started but before we get on with the
00:03:40
app
00:03:41
let's take a minute to talk about how an
00:03:43
android app comes together
00:03:44
the first piece of an app is the layout
00:03:46
which describes how the app should look
00:03:49
in android layouts are created by
00:03:51
combining different types of views
00:03:53
at its most basic a view is just a
00:03:56
rectangular area on the screen
00:03:58
but there are views that contain text
00:04:00
views that act as buttons
00:04:02
and even views for holding other views
00:04:04
and by combining
00:04:06
all these different types of views we
00:04:07
can make pretty much anything
00:04:10
the other piece of an app is the
00:04:11
activity you can think of the activity
00:04:14
as the code behind a layout it's where
00:04:16
you tell your buttons
00:04:17
what to do getting back to the code it
00:04:20
looks like we're looking at our activity
00:04:23
it also looks like we've got an error
00:04:25
and it's suggesting a solution
00:04:27
so i'll click that
00:04:34
accept the agreement and click next
00:04:39
and then finish
00:04:43
that looks much better now i'll take a
00:04:45
second to just make my screen a little
00:04:47
easier to see
00:04:50
and make my font size just a bit bigger
00:04:53
okay so android apps have two parts the
00:04:56
layout and the activity
00:04:58
and right now we're inside the activity
00:05:01
and if we look inside this oncreate
00:05:03
function
00:05:04
we can see a line that says set content
00:05:06
view
00:05:07
r dot layout dot underscore main
00:05:12
this is where our layout gets connected
00:05:14
to our activity
00:05:16
as you might have guessed this makes
00:05:19
activitymain.xml
00:05:20
our layout let's click on it and see
00:05:23
what we've got
00:05:26
and i'll click right here to hide this
00:05:27
side section
00:05:29
we can bring it back by clicking the
00:05:30
project pane
00:05:33
on this screen we can create our layout
00:05:35
by dragging and dropping views
00:05:37
we can also delete views by selecting
00:05:39
them and then hitting backspace
00:05:42
let's get rid of this hello world text
00:05:44
view and then start adding some views of
00:05:46
our own
00:05:47
so click it and backspace
00:05:50
the views are up here on the top left so
00:05:53
if we drag out a button
00:05:56
we'll get a button now one thing to call
00:05:58
out is that we're putting these views
00:06:00
inside of another view called a
00:06:03
constraint layout
00:06:05
what's cool about a constraint layout is
00:06:07
that it lets us position the views
00:06:09
inside by using constraints which let us
00:06:13
chain views together and makes creating
00:06:15
a layout
00:06:16
super simple let's try using constraints
00:06:19
with our button
00:06:20
to make it look like it does in the
00:06:21
mock-ups to align it to the bottom
00:06:24
start by selecting the button then click
00:06:26
on the bottom white circle
00:06:29
and drag it to the bottom of the screen
00:06:31
to make the connection
00:06:33
notice that it doesn't quite make it to
00:06:36
the bottom
00:06:37
this is because our constraint contains
00:06:40
an 8 pixel buffer
00:06:41
you can see the details about a view's
00:06:43
constraints
00:06:44
up here on the right and if you want to
00:06:48
change the buffer
00:06:49
you can type in the box or select a
00:06:52
value
00:06:53
let's change our buffer to 24.
00:06:57
next we need to center our button to
00:07:00
center something in a constraint
00:07:02
layout you just constrain it to both the
00:07:04
left
00:07:05
and right sides so let's drag the left
00:07:08
side to the left
00:07:09
and the right side to the right also you
00:07:12
may have noticed that we have two
00:07:14
screens here
00:07:15
the left one is showing us what the app
00:07:17
will look like
00:07:18
and the right one is more of a blueprint
00:07:21
view
00:07:22
showing us all the little details behind
00:07:24
the app
00:07:26
you can toggle between showing the
00:07:28
design
00:07:30
just the blueprint or both by using this
00:07:33
button
00:07:34
up here so just to make things a little
00:07:36
easier to see
00:07:37
for this screencast i'll be using the
00:07:39
design view
00:07:40
but keep in mind if you want to see the
00:07:42
blueprint view it's always there
00:07:44
awesome now to make our button say roll
00:07:48
we just need to update the text
00:07:49
attribute over here on the right
00:07:54
so we'll delete button and type roll
00:07:59
and let me make this just a little wider
00:08:01
so it's easier to read
00:08:03
we can zoom this in too the last thing
00:08:06
we need to do with our button
00:08:07
is make it wider to change the width of
00:08:09
a view you just update the layout with
00:08:12
attribute
00:08:13
let's make it take up the full width of
00:08:15
its constraints by changing this to
00:08:17
match constraint then to make this match
00:08:21
the mock-ups
00:08:22
let's change the buffer for both the
00:08:24
left and right constraints to
00:08:26
96
00:08:33
now that we've got our button let's add
00:08:35
our selector
00:08:36
in android that type of view is called a
00:08:38
seek bar
00:08:39
to find it click on widgets
00:08:42
and then drag out a seek bar discrete
00:08:46
then let's constrain the bottom of the
00:08:48
seek bar
00:08:50
to the top of our button and the sides
00:08:53
to the sides of the screen
00:08:59
let's also update the buffers for those
00:09:01
constraints to be 32 for the sides
00:09:05
and 24 for the bottom
00:09:14
finally let's change the layout width to
00:09:17
match constraint
00:09:22
we're good to go the next piece we need
00:09:24
is a text view
00:09:25
that says how many let's click on the
00:09:28
text tab
00:09:30
and drag out a text view
00:09:35
then let's constrain it to the left edge
00:09:38
with a buffer of
00:09:39
24
00:09:42
and to the top of the seek bar with a
00:09:44
buffer of 16.
00:09:51
last but not least let's change the text
00:09:54
to how many
00:09:59
next let's grab a horizontal divider
00:10:01
from the widgets tab
00:10:09
and constrain it to the top of how many
00:10:12
with a buffer of 16.
00:10:19
for the last step let's drag out one
00:10:21
final text view
00:10:22
and position it in the middle of the
00:10:24
remaining space by adding constraints to
00:10:27
each side
00:10:29
one to the left one to the top
00:10:33
one to the top one to the top
00:10:39
one to the bottom and one to the right
00:10:44
then let's make the text start empty
00:10:48
and change the text size to 144
00:10:51
sp if text size isn't visible over here
00:10:54
on the right
00:10:55
click view all attributes scroll down
00:10:59
all the way to text size
00:11:03
and set it as 144 sp
00:11:07
alright our layout is all finished but
00:11:10
before we get back to the activity
00:11:12
we should give our views some better ids
00:11:14
let's pivot back to view fewer
00:11:16
attributes
00:11:18
and change this last text view from text
00:11:21
view 2
00:11:23
to results text view
00:11:27
and then let's click on the button and
00:11:30
change its id
00:11:31
from button to role button
00:11:37
and click yes okay
00:11:41
let's flip back to main activity and
00:11:43
start wiring everything together
00:11:47
we've already seen that we connect the
00:11:49
activity to the layout with this
00:11:51
set content view line let's add some
00:11:54
space below that
00:11:56
and then we need to create variables to
00:11:58
represent our views
00:12:00
in kotlin there's two ways to create a
00:12:02
variable
00:12:03
val or var val is for things that don't
00:12:07
change
00:12:08
and var is for things that do for
00:12:10
example
00:12:11
if we were creating a person their
00:12:13
birthday would be a vowel
00:12:14
since it doesn't change whereas
00:12:16
something like what they want for dinner
00:12:19
would be a var let's start by creating a
00:12:22
variable for our roll button
00:12:24
let's leave a space after set content
00:12:26
view and on the next line
00:12:28
type val roll button
00:12:31
and set it equal to find view
00:12:35
by id and then inside these two carets
00:12:39
let's type button and hit enter to make
00:12:42
sure it gets imported
00:12:45
and then inside the parentheses we'll
00:12:47
put the id of our button
00:12:49
after r dot id so r
00:12:53
id dot roll button
00:12:57
this finds our roll button from the
00:12:58
layout and assigns it
00:13:00
to a new variable named roll button
00:13:04
now let's do the same thing for results
00:13:06
text view and our seek bar
00:13:09
val results text view
00:13:13
equals find view by id and we can hit
00:13:16
enter to auto complete that
00:13:18
and inside the angle brackets we'll need
00:13:20
to make this one a text view
00:13:24
and use the id r dot id
00:13:29
dot results text view then for the seek
00:13:32
bar
00:13:33
val seekbar and this equals
00:13:37
find view by id and then the angle
00:13:40
brackets this time
00:13:41
we'll put seekbar make sure to hit enter
00:13:44
so it imports itself
00:13:46
automatically and then for the id of the
00:13:49
seek bar it's r id and it defaulted to
00:13:53
seekbar now that we've got access to
00:13:57
each of these views
00:13:58
the next thing we need to do is make
00:14:00
something happen when we click on a
00:14:02
button
00:14:03
let's add a space and then on the next
00:14:05
line let's type roll button
00:14:08
dot set on click listener
00:14:12
and choose the option with the brackets
00:14:14
then hit enter to give us
00:14:16
more space in the brackets inside these
00:14:18
brackets
00:14:19
is where we'll specify what should
00:14:20
happen when we click on our roll button
00:14:23
first we'll get a random number based on
00:14:25
the value of the seek bar
00:14:27
and then we'll set that random number as
00:14:29
the text of our text view
00:14:32
so let's create a new vowel named rand
00:14:35
and set it equal to random
00:14:39
and hit enter to make sure it gets
00:14:40
imported
00:14:42
then parentheses dot
00:14:46
next end
00:14:49
and pick this option where we pass in an
00:14:51
integer to bound it
00:14:53
this will give us a random integer from
00:14:55
within a certain range
00:14:57
let's type seekbar dot progress
00:15:02
to have it generate a random number
00:15:04
between 0
00:15:05
and the value of our seekbar then on the
00:15:08
next line
00:15:10
let's set results text view
00:15:13
dot text equal to
00:15:17
rand which is our random integer
00:15:20
dot two string since rand is an integer
00:15:24
we need to turn it into a string before
00:15:26
adding it to our text view
00:15:28
and that's it now to run the app
00:15:31
let's click on this play button up here
00:15:38
then you should have a virtual device
00:15:40
from when we installed earlier
00:15:42
if you don't you should be able to
00:15:44
connect an android phone to your
00:15:45
computer with a usb cord
00:15:47
and see it up here to choose it as a
00:15:49
running target
00:15:51
i'll pick my virtual device
00:15:56
then we'll click proceed without instant
00:15:58
run
00:16:02
and it should boot up a virtual device
00:16:03
and run the app
00:16:07
and there we go we've got the app and if
00:16:10
we click roll
00:16:12
we get random numbers between
00:16:16
0 1 and 2. and if we put it all the way
00:16:19
up at 10
00:16:20
we should get between 0 and 9.
00:16:24
though ideally we'd have it go from 1 to
00:16:26
10 instead of 0 to 9.
00:16:29
also we might want to make this text a
00:16:32
little bigger and it looks like our
00:16:33
divider
00:16:34
isn't quite centered so getting back to
00:16:37
the code
00:16:42
first to make it show a number from 1 to
00:16:45
wherever our progress bar is instead of
00:16:47
starting at 0
00:16:48
we'll just add one to this number right
00:16:51
here
00:16:53
then to fix the issues with the layout
00:16:56
go back to activitymain.xml
00:16:59
let's make the text bigger by clicking
00:17:01
on this
00:17:03
coming into text size and let's try 24
00:17:06
sp
00:17:07
see how that looks that looks a little
00:17:10
big
00:17:11
we'll back that off to 16. that looks
00:17:14
better
00:17:16
then for the horizontal divider
00:17:20
if i can click it there we go we'll just
00:17:22
want to constrain that
00:17:23
to the right and to the left
00:17:30
and we can check if we got it
00:17:34
constrained
00:17:35
by looking at the constraints up here on
00:17:37
the right
00:17:38
looks like we're still missing that left
00:17:40
constraint
00:17:42
there we go all right then we can run
00:17:45
the app again by clicking on the green
00:17:47
play button
00:17:49
and if you'd like it to not show this
00:17:51
dialog each time you run an app
00:17:53
you can check this box down here
00:18:09
awesome now if we run the app again it
00:18:11
looks
00:18:12
much better and we get one two and three
00:18:17
instead of zero one and two great job
00:18:19
creating the app
00:18:20
i know that was probably a lot to take
00:18:22
in and you might be feeling a little bit
00:18:24
overwhelmed
00:18:25
but don't worry that's pretty much
00:18:27
everyone's experience it takes time
00:18:29
and a lot of practice to get good at
00:18:31
anything
00:18:32
and while you may not have a deep
00:18:34
understanding of android
00:18:36
you're off to a pretty good start i'm a
00:18:38
teacher at treehouse
00:18:39
an online school where you learn at your
00:18:41
own pace
00:18:42
at 25 a month you get access to the
00:18:45
beginner android development track
00:18:47
which has on-demand content that
00:18:49
includes videos
00:18:50
quizzes and code challenges teaching you
00:18:53
the ins and outs of android one step at
00:18:55
a time
00:18:56
click the link at the top of the
00:18:57
description to start your seven day free
00:18:59
trial at treehouse and get started on
00:19:01
the beginner android development track
00:19:11
[Music]
00:19:17
you

Description:

Android development can be a great way to turn your idea into reality or start a promising career as an app developer... and getting started is probably easier than you think. These days Android Development is done with a tool called Android Studio. Android Studio is kind of like Microsoft Word for writing Android apps; it helps organize our projects and gives us a user-friendly way to create what we’re looking for. In this video, we’ll walk through installing Android Studio and then make an app. Don’t worry if you don’t have any experience with Android or even programming in general; as long as you follow along we’ll all end up at the same place. Click SHOW MORE to view a list of our other popular Android videos! You can watch *all* of these videos as part of your free trial! https://teamtreehouse.com/subscribe/new?trial=yes&thcampaign=YTV23 -- These are just a few of the many Android development videos available to Treehouse subscribers. Download Android Studio https://developer.android.com/studio Android Development for Beginners (11-hour course) https://teamtreehouse.com/tracks/android-development-for-beginners?thcampaign=YTV23 Build a Simple Android App with Java https://teamtreehouse.com/library/build-a-simple-android-app-with-java?thcampaign=YTV23 Build a Simple Android App with Kotlin https://teamtreehouse.com/library/build-a-simple-android-app-with-kotlin?thcampaign=YTV23 Build a Weather App for Android https://teamtreehouse.com/library/build-a-weather-app-4?thcampaign=YTV23 Styles and Themes in Android https://teamtreehouse.com/library/styles-and-themes-in-android?thcampaign=YTV23 Testing in Android https://teamtreehouse.com/library/testing-in-android?thcampaign=YTV23 Localization in Android https://teamtreehouse.com/library/localization-in-android?thcampaign=YTV23 Android Widgets https://teamtreehouse.com/library/android-widgets?thcampaign=YTV23 Custom Views in Android https://teamtreehouse.com/library/custom-views-in-android?thcampaign=YTV23 Getting Started with Firebase https://teamtreehouse.com/library/getting-started-with-firebase?thcampaign=YTV23 --- Learn from over 1,000 videos created by our expert teachers on web design, coding, business, and much more. Treehouse teaches the in-demand technology skills you need to land your dream job. Follow Us! Twitter: https://twitter.com/treehouse Instagram: https://www.facebook.com/unsupportedbrowser LinkedIn: https://www.linkedin.com/school/treehouse-island-inc-/ Facebook: https://www.facebook.com/unsupportedbrowser

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "How to Make an Android App for Beginners" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "How to Make an Android App for Beginners" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "How to Make an Android App for Beginners" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "How to Make an Android App for Beginners" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "How to Make an Android App for Beginners"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "How to Make an Android App for Beginners"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.