I developed a firebase app, where one could post and you could like and react. Then, I stopped working on it. After some time, I started working on it again, when I was working on it, I found that the app now runs very slow, I had 3 layout (fragment used) and view pager added to it via adapter(before). Beforehand it used to work like a charm, but now when I move from one activity to other, the mobile device kind of like hangs. It was not behaving like this previously, why is that? Anyone facing similar problem?
First of all I would propose you allocate a larger memory to your ADB virtual device.
If this doesn't help, use Android Profiler to better understand the cause of this memory loss.
https://developer.android.com/studio/profile/android-profiler.html
Just go to your AVD device settings and disable Device frame, this will improve the speed of your emulator
Related
I encounter really strange behavior with android emulator. First of all, I am using extended monitor for development. So i code on my laptop and check the app on emulator on second screen. For some reason, I can't see emulator again after disconnect vga cable but I can see emulator is running on taskbar. Somehow, I can't bring emulator out on desktop screen or move to another screen, it just hidden and I don't know how to bring it out. It already happens to me two or three times. Can somebody help me out? What can I do to solve it?
Below is screenshots of my desktop with emulator running.
alt+tab
avd manager
It happens again when I change to another monitor for extended screen. I try what #Zoe suggested press ALT+SPACE to move but it doesn't work because move is grey out.
So my solution, I created two emulators, for two different monitors.
I am not sure why I got downvoted though.
Guys I have an application that works on the tablet.That is a smart house application.I root the tablet because I want to forbid the customers to use anything else but application on the tablet.Application is always visible and working non stop on the screen whenever tablet is on.But there is a problem.The problem is when application running about 1 day sometimes 2 days tablet collapses.That's why it needs to be restarted each time when that happens.I think it might be a problem of ram aka main memory.I just wonder about your thought.If I use garbage collector or some ram cleaner or ram expander, will it be a solution for me ?
Thanks in advance.
Your problem appears to be a memory leak in your application.
Since this is a complex issue to identify and/or resolve, you could try some common tools to aid you, such as:
https://medium.com/freenet-engineering/memory-leaks-in-android-identify-treat-and-avoid-d0b1233acc8#.z178mon4s
http://android-developers.blogspot.ch/2009/01/avoiding-memory-leaks.html
https://github.com/square/leakcanary
As we all know, Android resolution is rather fragmented.
I (like many others) don't have all the screen resolution, or OS versions to test my app on.
Emulators give a solution to the resolution and OS problem, but it is getting rather tedious and annoying to run my app on each emulator (even if they are already running) just to see one layout.
So, my question is; is there any way to run my app on EACH emulator I have selected, not doing them individually?
For now, I am using a solution called Manymo, which allows me to launch emulators faster, but my ideal solution would be to start 1 app, and have a setting to be able to launch it simultaneously on several emulators.
I am surprised to see after many searches, that although people ask about running multiple, I can't seem to find anyone who would like to launch an app in multiple instances simultaneously.
Thanks!
Once you've got your emulators running, I believe in the Run Configurations control, you can select Launch on all compatible devices/AVD's and then select Active AVD's from the dropdown. I believe this should launch your app on all emulators you have running. Could be quite taxing on your system, though, unless you're swimming in RAM.
Im not sure if this is exactly, what you want but you dont even need to start an emulator to check how a layout will look like.
the ADT plugin in Eclipse allows you to check how a layout will look on different versions and devices without having to start each emulator every time.
Graphical Layout , allows you to select a device, the orientation and android OS version.
I'm building the android application but I'm fed up while I'm designing my app every time I change even font size I will have to wait for re-installation is there any way to speed up this designing way?
and also
if I change the code every time I'll have to debug is there any way to speed up this task too?
My main question is if I navigated to 10 Activity and the changes are in 11
then I'll have to re-navigate every time I would be hectic. I can not move directly to the 11th activity coz I need some values from the previous activity and one more thing
something like on-web page we do just refresh that particular page and see changes
##Note: This question will help you a lot with this problem see here
I have felt that debugging on device directly is faster than using emulators. Also, if you're working in windows, its a little slower than Linux and MacOS. You can try those platforms too
Sometimes, it is inevitable that you have to re-install the apk to test some changes. In order to speed this up, the only way will be to try to fine tune your system, so that it runs faster.
For testing a simple change, like a new font size, you don't have to reinstall the apk however. You can visualize the changes inside Eclipse or use a tool like DroidDraw.
Yes, there is a faster way though, first step run the debugger in Android Studio. The first thing you notice is debugger breakpoints might slow debugging dramatically(something like that). Then click on this ...
Here you can see all the breakpoints you have in your project.
You can remove debug points left in your project in the bottom box.
This boosted my debug process in any device this is the best solution.
kishu27 is correct by saying that debugging on a device is far quicker than using the emulator. If you don't have a device available, you can keep the emulator open between runs, so you don't have to wait for it to initialize each time (which really is painfully slow).
Another tip - if you have a lot of resources in the project that results in a large APK file, you could take out all the unnecessary ones while you're debugging a particular part of the application. This can speed up the installation process if the APK becomes a fair bit smaller. (This comes from experience when I was writing an app that had many sample videos in for testing - cutting out all but one and using that one wherever possible when it didn't matter what video was there meant the APK was far smaller and vastly sped up installation time.)
I am trying to write an application with Mono for Android. In an attempt to do this, I'm using the default template in monodevelop. I can successfully compile and run the application. When I run the application, it looks similar to the one shown here: http://docs.xamarin.com/android/getting_started/hello_world
There are two oddities in my version though:
The button is red
I can't seem to actually click the button. When I use my computers mouse, it acts like it won't click the button. This is not limited to the application either. If I try to click the home or search button in the emulator itself, I noticed that nothing happens either. Its like the emulator is not responding to my mouse.
As someone new to working with Android, can someone please tell me what I'm doing wrong? I'm using MAC OS X with Lion installed. I'm assuming that I have the SDK and Java SDK installed properly considering the app compiles and when I press "play" I can load the app in the emulator. I just can't figure out why I can't actually click the button. So bizarre.
Any ideas?
The title of this question is pretty misleading, since you're saying that the emulator is not very responsive even outside the Mono for Android application. The problem here is with the emulator itself. The one thing I would recommend trying with respect to Mono for Android is to try starting the application without debugging, as debugging will add extra overhead to running the app.
The Android emulator is notoriously slow, since it is fully emulating the ARM instruction set in software. That said, there are certain things you can do in order to squeeze some more speed out of it. One thing that I've seen make a big difference is to decrease the screen size of the emulator image. Setting this to a small screen size (such as QVGA) can make a big difference. You can manage these settings through Android's AVD Manager.