Android on virtualBox gets stuck after idle - android

I am running a VirtualBox with android-x86 (as a replacement for the ultra-slow AVD emulator).
Its a Linux VirtualBox running android 4.0, on a Windows 7 Host.
The machine boots up and everything works fine, but if i leave the machine idle for less than 5 min, i can't perform any action - all the menus,buttons,etc are unresponsive although the android clock is changing, and i can go to command (alt + F1) and back to gui (alt + F7).
Has anyone came across this phenomenon or has an idea what goes wrong here?

I was able to get back to the screen by clicking ACPI shutdown menu(HOST + H)

It is pretty simple. Just hold ESC + MENU (A key between right-alt and right-ctrl) and the machine will wake up.

I had this problem today and couldn't solve with any keys provided by the documents.
Android will resume if you try to close the VirtualBox window, and when asked, select to send shutdown signal instead of forced shutdown.

Try disabling the sleep time to never. You can find it under settings.
Here are something users need to know
You can only use ESC, Menu, left, right, up and down keys to wake up the system.
To wake up the system ,you have to hold the keys mentioned above for at least 1 second.
You can push menu key when keyguard screen showing up to unlock screen.
You can use mouse to turn the wheel on the keyguard screen to unlock screen.
Source : http://old.android-x86.org/documents/how-to-wake-up-machine

open the "dev tools" app / developer options / stay awake.

Related

Reboot Android Emulator

I have Android on a Pixel 5 on the standard Android Emulator inside Android Studio. I just want to restart the phone using the power button like a normal Android user. However, clicking the power button just makes the screen go blank like this:
Clicking it again just wakes it up, and holding it down brings this up:
Most of the documentation I've seen tells me to do a cold boot, but when I do, I see this.
So, I delete these two files and try cold boot again. Android Studio displays some text that says something like "Start AVD now" but nothing happens. The phone does not restart.
I cannot find any way to restart the OS. It's jammed in one spot. I've deleted and recreated image after image without any way to restart the phone. Any help would be much appreciated.
Clicking on the dots menu on the emulator row on Device Manager you will find the option Cold Boot Now.
Alternatively, you can use
adb reboot

My Emulator won't unlock

I created a brand new emulator today but it is behaving weird today. Here is my setting:
When i start it up, it loads fine. Until it gets to the lock screen. I keep on dragging/swiping from bottom to top to unlock, but it wont! This is the first time I encountered such behaviour. I tried with target Android 6.0 - API Level 23 but was able to unlock. I want to test my app on Google API 23. Please help to figure out the proper setting values.
Happened to me as well.
Another solution in addition to what #TTRansmit suggested is as below:
Close emulator.
Go to AVD manager screen, edit your Emulator and go to Advanced Settings.
Select Cold boot as Boot option located in Emulated Performance section. This way you will be able to restart your emulator and get it unlocked without loosing data.
Power off (via holding power) on the device buttons and wipe data (from Android Virtual Device Manager) worked for me. It was turning off the Device Frame from the edit/Virtual Device Configuration screen of AVD that seemed to cause the problem.
I still did not solve this problem, somewhat. To get thru, what I did was I activated the Camera emulation then relaunched the emulator. On the lock screen, I dragged the Camera icon. The camera would crash and emulator would notify you about it thru a pop up dialog. Once you exit the dialog, it will go back to your homepage UNLOCKED! I know, it was weird but it worked.

How to stop emulated app from running? (Android Studio, 64-bit Win7 SP1)

Running Your App -> Run on the Emulator clearly explains how to RUN an app from within Android Studio by launching the emulator.
My question is -
Once I've done that: "How should I STOP the emulated app from running?"
Thought #1 - Use the "Run -> Stop (Ctrl + F2)" option on Android Studio's menu. But, when running my simple Hello-World-type application, that option is disabled.
Accordingly, Ctrl+F2 has no effect.
Thought #2 - Close the emulator window, by right-clicking the emulator's icon in my task bar, and selecting "Close window."
That closed the application all right, but then it seemed to leave things in a strange state.
-- When I tried to run the application again, it gave an error and I had to recreate the project.
That happened repeatably.
Thought #3 - Try shutting down the (emulated) Android device.
I tried that on Saturday evening: I held down the (emulated) Power button. Clicked the option in the "Device options" window.
It's now Monday morning, and it still says that it's "Shutting down...".
So, "How should I stop the emulated app from running?"
Thank you for any suggestions/help you can provide.
Russell
I now see that I had asked the wrong question.
I should have asked how to stop a running emulator.
Although I had been able to do so by right-clicking the emulator's entry in the task bar, and selecting "Close window", that had SEEMED to cause some problems.
["The selected device is incompatible" was displayed in the "Device Chooser" dialog.]
So, I thought that was the wrong way to do it.
Since then, though, I think I've figured out that something else was causing my problems:
I had an Android emulator process (emulator-arm.ese *32) which
hadn't terminated properly.
When I selected another device, I hadn't
given the (slow) Android emulator enough time to clear the "The
selected device is incompatible" error(s).
The problem process stayed in Windows' Task Manager after I shut down Android Studio, and Task Manager's failed to kill it.
So I rebooted my PC, and now everything seems to work OK.
Use the multitask button on the emulator itself to open the list of running apps, then click the "X" to close your app.

How to stop a program running under Eclipse?

I can't find an option to stop a running program (whether in debug or release mode).
So for now, I stop the program (returning control to Eclipse) simply by closing the emulator.
Is there a better way of doing this? Such that I don't need to close (and restart) the emulator?
I understand you want to stop your app on the emulator. For this you can open up the devices window (in the debug perspective), select the process and then press the stop button on the same window.
Those who find it tedious switching between perspectives to stop the program (like I did), you can view the devices windows in your current perspective by selecting
Windows > Show View > Other... > Android > Devices
Keep in mind that on Android, programs generally only 'stop' if you finish() or the system destroys them when memory is required. Why stop at all? You do not need to stop to fix/re-install/re-test, for example.
In the "Debug" perspective, select the root of the application under "Debug" (where the listing of active threads is) and click the stop button.
Working for me.
Windows -> Open perspective -> Other... -> DDMS
In the Android view, on the left windows, you can see "Devices". There should be a list of applications that is running now (Emulator or physical devices).
Click on the application you want to close. Normally the name is the name of the package + the name of the application
Now click on the symbol of "Stop".
To come back to the normal view, you just have to press on the Java button on the top right side.
You can also do it pressing:
Windows -> Open perspective -> Other... -> Java
this answer doesn't deal with Eclipse, but since this question comes up in a Google search for stopping a running Android program, I'd like to offer a command-line method. run adb shell, find the PID of the process you want to kill with ps, for example mine was:
u0_a46 2097 37 175520 19912 ffffffff 40037ebc S net.unternet.bleah.blarg
so then just kill 2097 and you should see the main screen show up again.
Add breakpoint to your code where you want to stop and then run it in Debug mode by pressing F11.
Figure 1 - Many Zombies were killed during the research of this Answer
Killing an Android application Java VM process at the OS level is not recommended. Unfortunately, this is exactly what the eclipse device window "stop" does, as does System.exit() and the shell "kill" command.
This subverts the normal app life-cycle methods such as onStop(), onDestroy(), and finalize().
Many apps require these methods for graceful exit (for ex. if they use system objects like Sensor, MediaPlayer, Equalizer, Visualizer, etc).
These system objects hang around with zombie death grips on system resources if release() is not called explicitly during these life-cycle methods. See fig. 1 above. This can prevent an app from restarting, and even require a reboot. That is the ungraceful aspect.
The only solution is to make sure you always exit your app cleanly with a call to onStop() or onDestroy() or at least finalize(). The debugger does this, as does the OS on shutdown.
You can set your app to trap SIG_HUP events in order to force a graceful exit from the command line.
The only time you would kill the app VM is in ANR (already a zombie) state. ANRs must be fixed. Never deploy an app that can enter this state. It is extremely rude.
You can use Google analytics and the Play Store to monitor for these in deployment. You don't want angry users giving single star ANR reviews after having to reboot due to your zombie application. Very bad.
Remember that Android is Linux: treat it like a real OS, and respect the app life-cycle otherwise you shall surely face the dreaded Zombie Apocalypse.
PS: If you don't like the Zombie analogy, how about Fantasia?
See picture:
1. Click on DDMS;
2. Select current app;
3. Click on "Stop"

Android Virtual Device gets hosed somehow

I am going through the Android tutorials and at some point an app won't load. The last message on the console is "Installing RelativeLayout.apk..." and it just stays there forever, instead of going on to the "Success" message. Visually, what is happening on the emulator is that it starts with the "A N D R O I D" phase, goes on to the chrome "android" phase, goes on to the home page, and then the little animating battery icon stops moving. After that we go back to the chrome "android" and just stay there forever. Quitting the emulator and rerunning the app doesn't help.
Looking at the log, using the adb tool with logcat, at one point the log lists service after service that died. This occurs right after this log message:
D/Zygote ( 32): Process 59 terminated by signal (11)
When I run adb logcat and have the emulator window visible at the same time, I can see that the battery icon stops animating just about when this message appears. No idea what this means.
I can fix the problem by going to Window --> Android SDK and AVD Manager which has a list of the AVD's if you click on "Virtual Devices" on the left. What I discovered to work is to quit the emulator, then in this window to select the AVD I'm trying to use, click "Start..." on the right, then in the Launch Options box that comes up, check Wipe user data, then hit Launch. The emulator will run until the home page shows up, then I can run my tutorial just fine.
What's causing the problem? What am I doing wrong? I blogged about this in my Into Apps blog and I'd like to be able to post the solution to the mystery as well.
What is your app doing? specifically, are you doing any CPU intensive work that could be stalling out the emulator? If you are, it could be you have a service that doesn't shut down properly, or a run away thread.
If not, i would say just uninstall your SDK and everything to do with the emulator and reinstall a fresh copy. Could just be that there is something screwy with your integration.

Categories

Resources