How to test Android lock-screen widgets in an emulator?
Asked Answered
L

5

13

It doesn't seem to work. I looked at the solution proposed here: Android emulator 4.2.2 not showing add widget option in lock screen but without success. Using the rev1 image (as the rev2 has a bug, filed here: http://code.google.com/p/android/issues/detail?id=58548)

No way that I get that '+' sign... Ideas?

Of course, the project is using Android 17.

Lampe answered 21/8, 2013 at 21:58 Comment(6)
I still can't find a way to test a lockscreen widget in the emulator for 4.4.2/API 19 and API Level L (preview).Pizzeria
@JohnBentley, Android L does not support lock screen widgets at all :-(Sforza
@Sforza As Eir writes, Android L is meant to support it but there is a logged bug (58548) with respect to it.Pizzeria
@JohnBentley Issue 58548 was triaged, and clearly there's a bug in Android level 17 - 19 emulators vs. devices. But the mention of Android L Preview there doesn't confirm an L emulator bug. Android L Preview (on devices and emulators) has a redesigned lock screen with no widgets. google.com/search?q=android%20l%20lock%20screen%20widgets . Maybe that'll change in later builds.Sforza
@Sforza "Maybe that'll change in later builds". Yes, there is no confirmation that lockscreen widgets (on devices and the emulator) won't be there in later builds. The official docs make no mention of removing the feature for Android L: developer.android.com/guide/topics/appwidgets/…Pizzeria
@JohnBentley Lollipop is released, without lock screen widgets. Instead there are lock screen notifications which are much easier and more obvious to use.Sforza
R
18

Use power button but set some lock screen (swipe for example) in Android settings before. enter image description here

Rica answered 3/9, 2019 at 20:46 Comment(1)
@Matteusz Although this is indeed the key step, for completion, you may want to add the step where you press the power button twice.Encrinite
Q
3

To reach the lock screen of Android Emulator, in recent emulators (using Android Studio 2.3) just click the "power" button in the Emulator. You'll get a black screen. Click it again and there it is, your lock screen.

Android Emulator

Quintana answered 26/9, 2017 at 14:39 Comment(1)
Nope. Without the settings change suggested in Matteusz's answer, this doesn't work, all you get is a blank screen.Encrinite
S
2

With the following combination, it's now working for me.

Install: Run Android SDK Manager. In the "Android 2.2.2 (API 17)" section, install Intel x86 Atom System Image. It offers Rev. 1. Also download, install, then finish installing Intel HAXM, if you haven't done that already. You might need to allocate more RAM to HAXM. IIRC, I have it set to 2 GB.

(Android SDK Manager has Rev. 2 of ARM EABI v7a System Image. According to Android emulator 4.2.2 not showing add widget option in lock screen, lock screen widgets work in Rev. 1 but not Rev. 2. I didn't test the ARM system images.)

Create an AVD with these settings:

  • Device: Galaxy Nexus (4.65", 720 x 1280: xhdpi)
  • Target: Android 4.2.2 - API Level 17
  • CPU/ABI: Intel Atom (x86)
  • Skin: Skin with dynamic hardware controls
  • Memory options: RAM: 768, VM Heap: 64
  • Internal Storage: 200 MiB
  • SD Card: Size: 100 MiB
  • Emulation Options: [x] Use Host CPU

Add a lock screen widget:

  • Launch this emulator AVD.
  • Run your app in this emulator.
  • If you need to get to the lock screen, press the simulated power button twice (off, on).
  • On the lock screen, swipe down on the clock widget. It should grow a large rectangle. Release the mouse.
  • Swipe to the right until you get to the "+" screen.
  • Tap the "+" then pick your widget from the list.

NOTE: Android L does not support lock screen widgets. The feature is gone.

I hope this works for y'all. There may be more independent variables, and the above configuration is surely not the only one that works.

Sforza answered 18/9, 2014 at 3:12 Comment(0)
R
0

Press(rather click :) ) the power button twice on the emulator. This will make it go into lock mode.After that , click on lock button again, the phone lights up with you asking to provide pin/finger print/pattern in case you had put them in your unlocking. Hope this helps..

Rapacious answered 11/10, 2017 at 5:9 Comment(0)
N
-3

Yes it does not seem to work with my AVD. But it works with genymotion. Maybe you can try it. Download it from http://www.genymotion.com/.

Nauseate answered 18/10, 2013 at 3:36 Comment(1)
I tried but it doesn't seem to work either. How did you get the '+' sign?Lampe

© 2022 - 2024 — McMap. All rights reserved.