Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Widget Preview app missing from Android emulator

Tags:

android

widget

This https://developer.android.com/guide/topics/appwidgets/#preview says

To help create a preview image for your app widget (to specify in the previewImage field), the Android emulator includes an application called "Widget Preview." To create a preview image, launch this application, select the app widget for your application and set it up how you'd like your preview image to appear, then save it and place it in your application's drawable resources.

I can't find this application on the latest Android system image, Android Oreo (8.1) API 27

This question has been asked and answered here, Widget preview image, but the application is missing.

So how do I generate a preview image?

enter image description here enter image description here

like image 226
daka Avatar asked Jun 14 '18 15:06

daka


People also ask

Why are my widgets not showing up Android?

The most common reason for a widget to disappear is when Android users transfer applications to a memory card. Widgets may also disappear after the hard reboot of your device. To return it, you need to transfer them again to the phone's memory.

How do I get my widget back?

To re-add the same widget, tap and hold on an empty space on your home screen, tap Widgets, and select the one you want.


2 Answers

The Widget Preview app will only show up when running an older version of Android on an emulator (API 26 or lower).

If the Widget Preview isn't showing up on your emulator, you need to create a new Virtual Device with a lower API in Android Studio:

1) Tools>AVD Manager>Create Virtual Device...

2) Select the device you'd like to use, click "Next"

3) In the next window, select Nougat, API Level 25. You may need to download it if you've never used it before. Click "Next", then "Finish"

4) Run the app on the new virtual device, and search for the Widget Preview again

After the preview has been created, the emulator gives you the option of emailing it so you can save it locally and later to the drawables folder of your project.

Hope that solves it for you too!

like image 196
Izzy Stannett Avatar answered Sep 22 '22 11:09

Izzy Stannett


Future readers, I solved this by using an older android version system image.

like image 38
daka Avatar answered Sep 26 '22 11:09

daka