1 00:00:00,000 --> 00:00:04,938 [MUSIC] 2 00:00:04,938 --> 00:00:09,510 Hi, I'm Ben, and I'm here to tell you about a little thing called widgets. 3 00:00:09,510 --> 00:00:12,040 Widgets are a fantastic way to keep your users 4 00:00:12,040 --> 00:00:14,240 up to date with what's going on in your app. 5 00:00:14,240 --> 00:00:17,690 With just a quick glance at the home screen, you can inform users 6 00:00:17,690 --> 00:00:21,330 about what's important without requiring them to open anything. 7 00:00:21,330 --> 00:00:24,200 It's a great way to help save your users some time and 8 00:00:24,200 --> 00:00:27,060 it gives your app a leg up on the competition. 9 00:00:27,060 --> 00:00:30,690 On top of that, we can even add interactions with our widgets, 10 00:00:30,690 --> 00:00:34,290 letting our users complete simple tasks right from the home screen. 11 00:00:34,290 --> 00:00:37,460 However, widgets aren't quite like the rest of Android. 12 00:00:37,460 --> 00:00:43,370 In fact, widgets are best thought of as views that you can embed in other apps. 13 00:00:43,370 --> 00:00:47,950 Also, an app that can contain a widget is called an app widget host. 14 00:00:47,950 --> 00:00:51,980 So your home screen app is almost definitely an app widget host. 15 00:00:51,980 --> 00:00:55,120 Unfortunately this presents us with a few problems. 16 00:00:55,120 --> 00:00:59,930 For starters, how do we communicate with a view that's inside another app? 17 00:00:59,930 --> 00:01:03,180 And how would we even initialize that view in the first place? 18 00:01:03,180 --> 00:01:06,807 We'll answer all of these all these questions in just a short while but for 19 00:01:06,807 --> 00:01:11,275 now, let's start off with just creating a simple widget to display a color. 20 00:01:11,275 --> 00:01:14,745 Then we'll build from that until we're finally able to display a list and 21 00:01:14,745 --> 00:01:17,575 interact with that list right from our widget. 22 00:01:17,575 --> 00:01:20,955 It'll be a lot of work, but we're going to take this one step at a time and 23 00:01:20,955 --> 00:01:23,165 explain everything along the way. 24 00:01:23,165 --> 00:01:25,915 So without further ado, let's move on to creating a widget.