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