From the course: Android App Development: Working with Widgets
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Introduction to pinning app widgets - Android Tutorial
From the course: Android App Development: Working with Widgets
Introduction to pinning app widgets
- [Instructor] If you're familiar with the concept of shortcuts in an application, it is basically the ability to add quick shortcuts to the icon of your application. Like quickly contact a specific person in a contact application. So in-app widgets is the basically the ability to pin your widget into these shortcuts. This way, instead of having your widget on your homepage you could have the widget as a shortcut inside of your application launcher. In order to do this, first you need to make sure you're developing for Android 8 or above, which is API level 26 or above. You need to first make sure your widget is declared in your application manifest, which is done for us when we create a widget using the stuff we've done in this course. The code should look like this. Then you need to insert similar code as you see here in your main application code. This way the application will check to see if the application pinning is supported and if so, will add the possibility of having your…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.