Is Deploying A Mono Android App to Emulator Always Slow? - android

I am building a simple mono android project and deploying to the emulator. Every time I try to run my program it takes at least 30 seconds to a minute to deploy and start the app in the emulator. Further, simple things like single stepping and inspecting variables take several seconds. Is this normal?
Also:
Is it much faster deploying to an actual android device?
Is it much faster using java instead of c#/mono android?
If no, how does one efficiently program on the droid with such slow iterations?
My computer is no powerhouse but it isn't crap either: core 2 duo 2.6ghz, 4gb ram.

I faced with same problem too. But you can solved it in two ways (at least both these ways helped me):
Use MonoDroid on Mac. It deploys to emulator much faster.
Run your application in emulator with same Android version. I tried few different configuration and this one the fastest (as for me): application with android 2.1 and emulator with android version 2.1.1. For me it works pretty fast.
Is it much faster using java instead
of c#/mono android?
I tried java and yes, it deploys (not works) faster.

1) It is faster and more effective to test your program on an android device.
2) It isn't critical.
My hardware is like yours, I develop in Java, and have a wait time similar to yours.

I'm developing android applictions using monodroid and deploy takes ~10s.
Just deploy without close emulator.
I was closing it all times and it take 30sec-1min to deploy.

I did next and it helps a Little in speed:
MonoForAndroid 4.1 API level 16
Add to hardware 'accelerometer'
And set Device size Ram to 512 instead of 1024 (Will not start with accelerometer and ram 1024)
Emulator began work faster, not enough but it is better than nothing

The same issue is without Mono too.
You can run emulator with parameters:
emulator #my_avd -no-boot-anim -qemu -icount auto
where #my_avd -- launch a virtual device named 'my_avd'
The full answer by #Timothy003 is here: Why is the Android emulator so slow? How can we speed up the Android emulator?
Works fine for me, deploying is much faster.

Related

Emulator taking too long time to launch

Whenever I am trying to launch my emulator it launches but only the android logo is shown ,after waiting for many hrs also it does not work.
Device-3.2"QVGA(ADP2)320*480 (mdpi)
API Level-17
It's well known that the factory emulator is extremly slow. The trick here is that the factory emulator needs to run on an ARM machine, so it needs to convert the ARM calls to your your x86 (or 64 bits) processor calls. It's likely to never run fast at all. In this situation, you may want to trust on the factory x86 images that make use of Intel's HAXM drivers, not available to everyone, and I couldn't manage to make it work myself, but it's useful to know that.
However! Since a while ago, I started using Genymotion's emulators. They rely on an actual virtual machine, which is way way faster than anything a factory emulator could achieve. Even if I'm running it on the lowest Mac Mini out there, it's pretty smooth. I'd personally give it a try (well, precisely, I gave a try)
https://www.genymotion.com/
Try allocating more memory for it to use. The Android Emulator is super slow as it is, but if you are not giving it enough memory it has the ability to never load.
Google emulator uses ARM opcode, a kind of machine language. It must convert from ARM opcode to Intel opcode. That's why it's slow. The problem seems not to be RAM but CPU. Improving CPU will improve the emulator.
References to solve this issue:
Making the Android emulator run faster
If you are using your emulator in windows than you can use Microsoft Andriod Emulator.
Install microsoft android emulator in your windows os
If it is taking too much time in loading make sure you have installed the "HAXM installer" in SDK tools , Also make sure "Hyper V" option is also unchecked in "Turn Windows features on or off" in Control Panel --> Program and features.
Only After unchecking this feature you can install the HAXM installer.
After doing this the Emulator will not take time to load.
Try creating the Android virtual device with more RAM than usual. The usual is 1 GB. Even though I tried this on another lower end PC, it was still slow. I think it can be a problem with your hardware. Lower end hardware tends to have problems running emulators.
The problem seems not to be RAM but CPU. Improving CPU will improve the emulator.

Emulator is starting and running slowly for android application using elicpse

I am using Eclipse new v22.6.2 . My emulator is starting and running very slowly... How to overcomes this problem..using 3.7"WQVGA(240x432:IDPI).
system configuration is 2GB RAM and 64 bit windows 8 and i3 processor
Increase eclipse Memory size since you emulator is using its memory to run. See here to give more memory.
Genymotion is the better option if you want to test your app with emulator.
In my personal opinion it is always best to test app with the real devices.
I recommend using Genymotion (https://www.genymotion.com/). It is free for personal use.
Just had this issue myself (even though I believe to have a nice piece of hardware) and found that it's really faster as it claims to be.
In my notebook, it will get up and running in about 20-30 secs. Hope that will suit your needs.

How to decrease Eclipse AVD Load Time?

I am working on an android application, uing eclipse IDE. However it takes around 10-15 minutes to load my AVD and run the application.
My system Configuration:
RAM 8GB
intel Core2Duo Processor 2.53GHz.
OS: windows 7
Is their any alternative to increase our AVD's speed, without changing my systems hardware configurations.
You can setup an Android Virtual Machine using VirtualBox :
http://www.howtogeek.com/164570/how-to-install-android-in-virtualbox/
And to deploy to the virtual box :
android emulation on virtual box in eclipse
I tried this a while back and it was quite a performance improvement difference. I haven't done this in a while because I bought a pretty high end phone and I just use that now.
Is their any alternative to increase our AVD's speed
Using the x86 emulator will help.
That being said, your computer would appear to have issues. With that configuration, even the ARM emulator should take at most a minute or two, at least on Linux. Windows 7 perhaps adds some more overhead, but I would not expect it to be that much.
Also, bear in mind that you can usually keep your emulator open all day -- you do not have to exit and restart the emulator for most work.
GenyMotion have an Android Emulator that is pretty rapid. (not an AVD)
http://www.genymotion.com/
Genymotion is an emulator using x86 architecture virtualization,
making it much more efficient!
Taking advantage of OpenGL hardware acceleration, it allows you to
test your applications with amazing 3D performance.
It's free for personal use, has preconfigured devices (like N7 or Samsung GS3 etc).
I think you'll really like it.
You can select the snapshot options. On the first next start, a snapshot will be created. This will improve the launch speed of the emulator every other start...

Android SDK running slow

I have installed Android SDK on my computer. I have a intel i7-2600 processor and a Zotaxc 460 gtx fermi and 12 gb of ram. Basically saying, it shouldn't be running slow. Any suggestions on how to speed up the apis? or is it just slow?
Assuming you are referring to the Emulator and not Eclipse or something, you can speed up the Emulator a bit by choosing a smaller screen size for the virtual device, like HVGA instead of WVGA, etc. But that only goes so far. The emulator is just not very fast right now. They are working on it, however. I believe they show some of their early work in this Google I/O session.
If you mean the AVD (the android device emulator) is running slowly, then it is behaving as expected. Perhaps you have an android device you can plug in and run your app on? I would recommend you download developer drivers for whatever device your using instead of the bloated ones they try to get you to download.
Good luck.
Here is some usefull question that is about speed of android emulator:
Why is the Android emulator so slow? How can we speed up the Android emulator?
Eclipse performance can by improved by setting eclipse.ini. For example I have set -Xms512m
-Xmx2048m. Without this options, Eclipse has too few memory to open my project.
Disable the boot animation with -no-boot-anim, "Disabling the boot animation can speed the startup time for the emulator."

Android emulator uses 100% cpu even if nothing i running on it ?

I have a celeron processor :/ and android emulator on eclipse uses 100% of cpu and hangs everything unless I kill it . I was just trying a hello android program from a book and don`t know much about android or even eclipse .I have the android-eclipseplugin installled .
Can someone help me with is ?thanks!
As others have said, the solution is disabling sound. Unfortunately, in recent Android Studio releases (I'm using 1.4) the option to disable sound has been removed from the GUI. To disable sound you can do it either by launching the emulator from the command line with the -noaudio flag, or by editing the AVD's config file and setting the following parameters:
hw.audioInput=no
hw.audioOutput=no
On Linux, I found that file at ~/.android/avd/myAVD.avd/config.ini
I've had the exact same problem and found a solution that works for me.
In the config of the AVD I've set an extra flag "Audio playback support" to "no".
I've also made sure the AVD has 1GB of RAM.
This worked for me.
For me, it was unchecking the Multi-Core CPU check box
Niels' answer worked well for me https://stackoverflow.com/a/7706018
in that the emulator stopped using 100% CPU (dropped down to 10-15%)
Furthermore it had another useful "side effect". I noticed that playing video in Totem or music in RhythmBox would block while the emulator was running. VLC would play video but refuse to play the accompanying soundtrack for the video.
As soon as the emulator was killed, music would start playing.
Niels' answer to set "Audio playback support" to "no" prevents this issue.
I am running Ubuntu 11.04 and Android emulator version 13.0 (build_id OPENMASTER-172639).
I had same issue on my macOS High Sierra and for me helps to create new AVD device and choose CPU/ABI = x86_64, not x86 in Android version dialog. Hope that helps.
The Android emulator is emulating an ARM CPU without hardware acceleration which can be pretty slow even on a core2duo for example.
You can try to reduce the screen resolution of the virtual device which should result in a small performance increase.
The emulator is notoriously slow to start; it can take 15 minutes or longer on an underpowered machine. You can speed start-up a bit by passing the -no-boot-anim to the emulator start-up command. Other emulator options are described here. Also, some AVDs start faster than others. Try creating an AVD with the lowest level SDK that is useful for you.
Once the emulator has started, you don't need to shut it down. When an app exits (or crashes, or whatever), you can just run it again.
One alternative that worths mentioning is Genymotion. It's an android emulator based on VirtualBox, with pre-created images. It supports some features the stock Android emulator isn't very good at, like Wifi 3G, Bluetooth, GPS (with a fancy Google Maps integration, so you don't have to find coordinates manually), multiple screens, etc.
It worth giving it a try at http://www.genymotion.com/
I had this issue running the emulator on Ubuntu 14.04. Disabling the audio does bring down the CPU usage, but in case you need audio to work, it can be fixed by adding a symlink:
sudo ln -s /usr/lib/x86_64-linux-gnu/libpulse.so.0 /usr/lib/x86_64-linux-gnu/libpulse.so
The reason for this is that the emulator tries to use pulseaudio as the backend, but will be unable to link to libpulse.so, which does not exist on Ubuntu (unless you installed the libpulse-dev package). Then it will fall back to ALSA, which constantly calls poll, causing 100% CPU usage.
A fix for the emulator is coming, but for now, adding the symlink solves the issue.
I strongly recommend not to use android emulator. Use VirtualBox + android x86 OS (you can download it here ), and you will get real perfomance increase.
Unfortunately, as far as i remember, it is not from google and it supports only Android 2.2. I really do not understand, why google is not going to make simulator as fast as iPhone simulator , or to make official x86 release for debugging. I do not need emulating ARM processor instructions and I think 99% developers do no need it too.

Categories

Resources