This workshop will be retired on May 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
In this video we'll learn what widgets are and talk about what we'll be doing in the course!
Related Links
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
[MUSIC]
0:00
Hi, I'm Ben, and I'm here to tell you
about a little thing called widgets.
0:04
Widgets are a fantastic
way to keep your users
0:09
up to date with what's
going on in your app.
0:12
With just a quick glance at the home
screen, you can inform users
0:14
about what's important without
requiring them to open anything.
0:17
It's a great way to help save
your users some time and
0:21
it gives your app a leg
up on the competition.
0:24
On top of that, we can even add
interactions with our widgets,
0:27
letting our users complete simple
tasks right from the home screen.
0:30
However, widgets aren't quite
like the rest of Android.
0:34
In fact, widgets are best thought of as
views that you can embed in other apps.
0:37
Also, an app that can contain a widget
is called an app widget host.
0:43
So your home screen app is almost
definitely an app widget host.
0:47
Unfortunately this presents
us with a few problems.
0:51
For starters, how do we communicate
with a view that's inside another app?
0:55
And how would we even initialize
that view in the first place?
0:59
We'll answer all of these all these
questions in just a short while but for
1:03
now, let's start off with just creating
a simple widget to display a color.
1:06
Then we'll build from that until we're
finally able to display a list and
1:11
interact with that list
right from our widget.
1:14
It'll be a lot of work, but we're going
to take this one step at a time and
1:17
explain everything along the way.
1:20
So without further ado,
let's move on to creating a widget.
1:23
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up