How to test Android lock-screen widgets in an emulator? - android

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.

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

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.

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.

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..

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/.

Related

Android Emulator window not displaying properly

I am very new to android development. I have issues in Android AVD device display. It display the content very big. Here I cannot attach screenshot.
The lock screen looks like the very big font for Time and Date which
beyond the screen size.
Even I cannot see the lock icon to go to Home screen.
Device Definition:
Device : Nexus One(3.7", 480 x 800:hdpi)
Target : Android 5.1.1 - API Level 22,
CPU / ABI : ARM (armeabi - v7a),
SKIN : WVGA800,
RAM : 512 ,
VM Heap: 32 ,
Internal : 1024
I already searched for fix and deleted device and recreated the device, but same problem. But I cannot find the solution.
Thanks a lot.
Create a AVD having below configuration.
It is very fast for testing application.
See the image below.
I found that Device and Skin selection is somewhat an issue with newer Android SDK(not in 24.2.0 and lower, tested 24.4.1, 25.2.5 and has this issue). When I choose any named Device like Nexus *, then I have to choose only skin Skin with dynamic hardware controls and if I choose unnamed Device(with only size and resolution mentioned) then I can choose any of the Skin in the list.
Screenshot of how the problem is looking is at https://android.stackexchange.com/questions/96949/android-avd-not-displaying-appropriate-scale
if you match your laptop/computer resolution to your external monitor's resolution. Then you can return back to your PC's resolution.
On you laptop/Computer From Settings -> Display settings -> Decrease the screen layout (125%) or decrease the scale and layout of your screen and restart emulator.
This is how to change display settings
before result
Before changing the display settings
after result
After changing the display settings
P.S.It's temporary solution.

How to create Android-M Preview emulator?

I think I have installed all the system images required for android m preview, but still my emulator is showing nothing, its always blank. Please help me
After Suggestion i have downloaded the other requirements, but still its not working
You have sufficient files to create the emulator might be you are editing the existing emulator, i suggest try to create a new emulator, and try to keep the Ram consumption lower to get better performance.
Refer from the above link you can create your new emulator by following below steps
Step-1: Go to Android SDK folder and run AVD Manager. Click on Create
Note: Use default value for Max VM application heap. As Android supports variety of displays, you can explore with different devices by selecting in Device: dropdown
Step-2: Select the virtual device which you just now created and click Start
Step-3: Do not make any change under Launch Options and click on Launch button
Step-4: Emulator will start a few Command Prompt windows flicker. You should now see the following screen, with the Android device booting up, which will take about five minutes
Step-5: You should now see a screen saying Emulator has been successfully installed
Your Windows/Mac PC should now be ready to get started with the Developer Preview.
Go to Android SDK manager you need to download the Android m preview section.Then follow these steps
Step 1: Run AVD Manager and click on Create.
Note : Select a small resolution screen if your RAM is low.It will be a plus in case of performance part.
Step 2:Enter the Ram value to 1Gb if your system(Computer)RAM is about 4gb or RAM value as 2gb your system(Computer)RAM is about 6gb or 8gb.
Step 3:Select the device which you created now, press Start and select Launch Button.
Step 4:You should get a alert box showing that Successfully installed.
Step 5:An android device with android device booting up screen will be appeared and it will take time depending upon the RAM you allocated at the time of creating the Android Device in AVD.
NOTEmake sure not to run too many another programs while you trying to launch or using the emulator.(make sure the IDE is uptodate)
Happy Android M Preview....
If you want to create MNC(Android M Preview) emulators, you could follow these steps:
1, Of course, downloads MNC System images. Open SDK Manager, select images like Android TV Intel x86 Atom System Image, ARM 64 v8a System Image, ARM EABI v7a System Image and something like that.
2, open AVD Manager by clicking the button on the top of Android Studio. Then you will see "Your Virtual Devices" window.
3, Click the button of "Create Virtual Device" at the left bottom of the window. Then you will see "Select Hardware" window.
4, then select the category and name of the emulator you want, and then "Next".
5, if you have succeeded downloading MNC System Images, you will see them from the "API Level"
6, and then click "Next", you will see "Android Virtual Device(AVD)" window, you can change settings if you want to.
7, click "Finish" and wait, util emulators are prepared.
I had the same problem,
I copied the system image from the default directory:
C:\Users\eli\Downloads\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\system-images\android-MNC\default\arm64-v8a
to the image root dir:
C:\Users\eli\Downloads\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\system-images\android-MNC\arm64-v8a
I restarted eclise, and now, I could see the android M and the arm64 system image.

Android emulator slow & faulty after SDK upgrade

Recently upgraded from API 16 to 17. Has been retaining all AVDs that were added before and they were working fine after the upgrade too. But today I deleted all old AVDs and added few new ones, each with each device specification available. Earlier, the booting time was around 5 minutes for AVDs with recent versions (4.1.2) and around 2 minutes for AVD with 2.3.3. But now, AVDs with 4.1.2 or 4.2.2 takes 10 to 15 minutes to boot. Moreover, it fails to load launcher. When I touch on the launcher button on the Home screen, it loads the list of Apps and displays a usage tip, "To add an app to your Home screen, touch & Hold it" over it. So far expected. But touching on "OK" for this tip leads to "Unfortunately, Launcher has stopped" error. Not touching on anything leads me back to the home screen.
Tried unchecking AVD options, "Hardware keyboard present" and "Display a skin with hardware controls". Still the issue remains.
It was a memory issue. Problem fixed on incrementing the default value of VM heap by a factor of 16. (16 to 32 and 32 to 48).
I know this should be more a comment then an answer, but I'm too new to StackOverflow. Hopefully a mod transfers this answer.
Are you using an Intel image? Because those ARM images are really slow. When you want to use an Intel image you should also install HAXM (https://stackoverflow.com/a/10772162/1741111). Be sure to select it the right settings. 768 RAM is the maximum on Windows.
These are my settings:
Yes, same issue on my latest SDK for Android 4.4. I am running the "ARMeabi-v7a", from the AVD (Android Virtual Device) Manager.
Every time I started the emulator, it would crash once you selected the apps screen, and tried to launch an app. The emulated app launcher would crash with
Unfortunately, the Launcher has stopped.
Really a pain.. I am running at the API level 19, so probably due to internal program bloat...
Once I raised the VM heap memory from 16 to 48, I noted that a special help program runs, with a big outline of a hand pointing at the "Downloads" app, and explaining that you can press and hold any app to move it to the main screen.
I am running on a WIN-XP (32-bit) old dual core Centrino Toshiba Satellite Pro, so maybe on newer 64-bit machines, the error does not show up. But thanks, Rajeesh.
I just used AVD Manager to edit the parameter screen for the ARMeabi-v7a emulated target device, and now the emulator launches successfully, and I can see (and run) my first "Hello World" app, built with the Eclipse ADT stuff. - Mark_L

Can't Create Nexus 7 AVD

I am trying to create a Nexus 7 AVD. Regardless of the choices I make, I can not seem to actually create it since the OK button is greyed out.
The Choices I made:
AVD Name: Nexus7AVD
Device: Nexus 7
Target: Android 4.2 - API Level 17
Keyboard: Not present
Skin: Display
Front Camera: Emulated
Memory: RAM 1024, VM Heap: 32
Internal Storage: 200 MiB
SD Card: No selection
Emulation Options: Use Host GPU
What is wrong with the choices I made?
Thanks
Eric
Look at my picture, this worked for me.
I think you don't have system image installed in your IDE. Install System image by selecting Android SDK manager option and checked the system images for the targeted device you want.
You need the following:
AVD name - must exist and mustn't have any spaces (which is dumb cos you cant have 'Nexus 7')
Device
Target - API level, which you must have installed via Android SDK Manager
CPU/ABI - again needs to be installed via SDK manager (under your chosen API level you will have various system images eg ARM EABI v7a System image - these relate to CPU types. You need to install the one chosen i the dropdown, though I think if its not installed you dont get the option)
Skin - needed (choose WSVGA as the simplest, I think - but havent experimented with this)
The rest is optional I think. Have heard a suggestion that SDcard should be 'binary multiples' - eg 256, 1024 etc, but havent verified that (just added that as FYI - isnt needed to get the OK button visible).
With all that the OK button should be clickable.

Android emulator resolution, aliasing, gpu emulation

I just downloaded the Android 4.1 (API 16) packages using the SDK Manager and created an Emulator for JellyBean. What I see now is everything on the JellyBean emulator is aliasing. When I open the screen capture dialog in DDMS, the screen is HUGE - I think the emulator is scaling that down, thus causing the aliasing. Screenshot:
And here are the emulator settings:
I've used these same settings (minus the GPU emulation = yes) before for my ICS emulators, including the built-in screen resolution WXGA720. What settings should I change to get rid of this problem?
Make sure that Scale display to real size is unchecked in the Launch Options dialog (which appears after clicking on Start... in the AVD manager).

Categories

Resources