10

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.

Community
  • 1
  • 1
Eir
  • 1,003
  • 9
  • 24
  • 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). – John Bentley Jul 29 '14 at 01:55
  • @JohnBentley, Android L does not support lock screen widgets at all :-( – Jerry101 Sep 18 '14 at 03:12
  • @Jerry101 As Eir writes, Android L is meant to support it but there is a logged bug (58548) with respect to it. – John Bentley Sep 19 '14 at 08:30
  • @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. https://www.google.com/search?q=android%20l%20lock%20screen%20widgets . Maybe that'll change in later builds. – Jerry101 Sep 19 '14 at 19:47
  • @Jerry101 "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: http://developer.android.com/guide/topics/appwidgets/index.html#lockscreen – John Bentley Sep 21 '14 at 01:04
  • @JohnBentley Lollipop is released, without lock screen widgets. Instead there are lock screen notifications which are much easier and more obvious to use. – Jerry101 Nov 21 '14 at 04:26

5 Answers5

12

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

Mateusz Kaflowski
  • 2,221
  • 1
  • 29
  • 35
  • @Matteusz Although this is indeed the key step, for completion, you may want to add the step where you press the power button twice. – Ash Dec 02 '19 at 03:46
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.

Community
  • 1
  • 1
Jerry101
  • 12,157
  • 5
  • 44
  • 63
2

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

Diego Freniche
  • 5,225
  • 3
  • 32
  • 45
  • Nope. Without the settings change suggested in Matteusz's answer, this doesn't work, all you get is a blank screen. – Ash Dec 02 '19 at 03:45
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..

Paathak Kumar
  • 65
  • 1
  • 8
-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/.

xxx
  • 15
  • 3