Home » Android » Widget Preview app missing from Android emulator

Widget Preview app missing from Android emulator

Posted by: admin June 15, 2020 Leave a comment

Questions:

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

How to&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!

Answer:

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