Any way to speed up the Debugging of Android Application? - android

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

Related

Android Program is running slow

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

Eclipse won't run Android app until I click Run a few times, no feedback or status information

I've started Android Development and I'm using Eclipse for the first time in years, coming from a Visual Studio background. When I click Run in Visual Studio I begin to get feedback immediately. Using Eclipse however, I get very little feedback and it's only after a few clicks of the run button.
It normally takes a few minutes for the app to run after making even only the littlest changes to the UI XML, and I will see nothing in the LogCat or Console tabs. I'll click run.... nothing, click run again after a few minutes.... nothing, click it again after a few minutes.... and finally it'll give me some feedback that it's launching the app.
Is there any way to improve the responsiveness / feedback I'm getting?
Yeah....just waiting. You don´t have to push the run button many times. I would be happy if there where another solution, but fact is, that the emulator is terrifying slow. Even this depends on the properties from which You created your AVD. There are some setting when creating a new one, internal storage and ram size. The lower these values are the faster it creates an emulator. This depends on what You need, if You don´t need sd card storage, disable it. If you don´t need much ram size, set the minimum. Even there are some tricks to speed up a little bit:
http://developer.android.com/tools/devices/emulator.html#acceleration
It seems that there is a faster alternative emulator, but I hadn´t tried it:
http://enisgeeks.wordpress.com/2013/03/21/an-amazing-alternative-to-android-emulator/

starting Android app on multiple emulators simultaneously

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.

Why am I getting an empty screen in Eclipse when emulating a simple Hello World program for Android?

I'm following this tutorial: http://developer.android.com/training/basics/firstapp/running-app.html#Emulator
In it there is a simple code for a layout with a Text parser and a button. When I input the code in my Eclipse and "Run" the program I arrive at an empty Android phone simulation. The phone diplays "Android" across the screen and my program does not run. Please instruct me on where I am making a mistake. My code is equal to the code in the tutorial, by the way.
It's booting. You just have to wait for the emulator to start. It's just like real Android devices: it takes a while to boot. When it shows the desktop, it will launch your application.
On slow machines it might take a while (and I mean a good while). May I suggest a faster/stronger machine, or even better, a real Android device, for testing.
For better performance, do not close emulator window, this way it won't have to boot each time.

Android Emulator does not work with Mono for Android

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.

Categories

Resources