Android website recommends to test an Android application on a real device before releasing it to others. Based on this I would like to know one thing:
When USB debugging is enabled on the device and android applications are tested in real time, does it have any effect on the functionality or performance of the Android phone?
What I mean to say functionality is, about the working speed, app failure or anything similar.
No, there is none or a little bit that you wont even notice. Your phone will still function normally. You can also use eclipse to log your phones performance and other things. The only thing the eclipse do when you debug the application is attach the debugger to your app and debug it. It will only install your app and lets you test and debug the app. No performance degradation is done. However the application will still occupy the memory on your phone. So it will definitely consume your internal memory like every other application does.
USB debugging allows you to use the debug in Eclipse or any other Android SDK you are using to test your application. You can have it set to allowed (USB debugging) and you won't even notice it. If anything, it will just drain your battery faster
From the perspective of an application it won't affect performance, but at platform level it can.
Related
I am self teaching my self android and making an app for a mobile application contest. I have all my code working on an emulator with the correct permissions and for a sms text being sent to user specified contacts as well as a link to the google maps position of the user. I will be demonstrating the app on a tablet that only has WIFI and doesn't use cellular data.
My question is will I have to make any additions for the app to be able to be used on this tablet or would it work just as the emulator does?
There are not some ultra big difference between real device and emulator but still there are some :
You can't test onTouch events on Simulator I mean you can do it via mouse clicks but it's not the same
Emulator use your computer CPU ram and things and application will probably run much faster on Emulator then on Real device (You should be aware of that)
Regarding GPS and location you can simulate that on emulator almost the same as on Real Android device
You can't get the real performance result on Emulator because it will ignore all apps running on real device, battery etc...
But generally if app is working correctly on Emulator it should work on Real device also but i suggest testing on Real device if possible.
From #Spirit answer below:
Emulator use your computer CPU ram and things and application will
probably run much faster on Emulator then on Real device (You should
be aware of that)
all of my experience has shown that testing on a real device is actually leaps and bounds FASTER than using any emulator. it's much easier to debug as well.
i really recommend using a real device to test on.
I'm developing an android application, since there are many assets, the generated apk is near 10M. Now deploying it to a simulator is very slow, often takes me 3 or 4 minutes, which is unacceptable.
I've used Robolectric to test most of the logic, which is very fast. But sometimes I still need to use emulator(e.g. adjust the UI), which waste me a lot of time.
Is there any way to make it fast?
This is my experience, too. Debugging with the software emulator is very slow.
It is much faster to use a real device in debug mode. However, you may run in other limitations
Well since somebody suggested Android x86 as an alterante testing Emulator, I'll also present my favorite. This might not be an alternative for everyone but for me it's perfect! Use the Bluestacks Player. It runs Android 2.3.4 and is very fluent and fast. Sometimes even faster than a normal device. The only downsize is, that you can just test Apps on the API Level 10 and just on one screen size, but it's perfect just for testing if it's working or not. Just connect the Player with the adb by running
adb connect 127.0.0.1
After compiling it installs instantly. Very impressive, considering I have a rather average computer hardware(dual core with 4 GB of RAM)
I've found android-x86 image on VirtualBox many times faster for deployment than an emulator running on same machine, sometimes even faster than a USB device.
EDIT
Please use the android image provided by vmlite, not the one provided by android-x86, and refer to this important question: How to change the screen size of vmlite android?
Actually, I absolutly never use the Emulator, which is way too slow in every situations.
I test and debug my apps directly on real devices (and use the ADB screenshot features when I have to pixel-check some screens..)
Hope this helps...
What is the recommended way of testing an app on a device? The emulator is slow, mostly unresponsive and a cpu beast on my machine, so I use my phone to test my app. When I make a change to code, Eclipse builds it automatically, and then I debug it on the device. Is this the most efficient way to test small changes in code?
Android has some information on testing here. Personally I've found that testing code is much faster on a device. Other options without a device is to use something like Android x86 and run it in virtual environment like VirtualBox - this can be faster than the emulator. In my opinion, to really make sure your application is working as expected (especially with graphics and memory usage) is to test with the device(s) you intend to deploy the application on.
That's how I test my code, the emulators and on an actual device are the only ways I know of. I usually use an actual device, but I think you can keep an emulator running to speed up time a bit, but not too much.
It's in my opinion a good way to check the general functionality of your application. If everything works fine, I would use the emulator to check with different versions of android/screen sizes/resolutions etc. Maybe you can ask a friend who has a more powerful PC. The best possible thing is of course that friends/family/relatives etc. own Android devices so you can test your application / let it be tested on real devices.
There is some way to know if my Android app is running on debugger or on a phone?.
I want to check some variable, property, or something like that to know where the app is running to prevent some crash when I call some 3rd applications (not available on debugging time)
Thanks and sorry for my poor english
You might want to look into DDMS
You can access logs, threads and heap information. also check running apps and services. You can also simulate phone behaviours on the emulator, like an incoming call, as an example. Well, I would also recommend reading all the information in the debugging section, there are a lot of useful tools available for Android developers.
You mean detecting the emulator? Because you can run under debugger also on your device.
Use this to detect the emulator (worked for me a while ago):
"google_sdk".equals(Build.MODEL)
I started developing android applications. And am testing with the android emulator. Do I really need android phone before releasing it for public usage?
Short answer No. You can test and build a android application package with the SDK and an emulator. But I would say there are usually many things which it would be wise to test on a device.
Personally I have noticed that the emulator does not give a good indication of response times for UI controls. It is usually necessary to move functionality which has long processing times into background threads to maintain user interactivity without the 'force close' pop-up. Testing the effectiveness of your UI responsiveness must be done on a phone to be meaningful.
Network connectivity is another aspect which can be vastly different on a phone, 3G or wifi.
Device sizes and Android platform versions can be tested effectively on the emulator.
Some phone allow hot-swapping of the SD card (replacing the SDcard without turning off the phone). I am not sure how to replicate this on the emulator.
There may be many more things which may only become apparent when using your application on a real device. I would strongly suggest to always test under real conditions when feasible for any commercial project.
From a technical perspective there's no reason why you can't develop purely on the emulator. You're not going to be able to test on every available device, so there's always going to be possibility of device specific bugs that you've missed.
However, I'd strongly recommend getting an actual phone to test your application on.
For me the biggest difference between an actual device and the emulator is the difference between using the interface with your fingers and using a mouse. Interactions which make sense in the emulator sometimes don't work as well when you start using touch on the screen. So if you develop purely on an emulator you'll won't lots of little improvements to your UI that would obvious when you used your app on a phone.
You can't feel a real app in your hands until you have a real phone. (I'm telling you as an Android developer)
So, developing w/o real phone is possible, but real phone gives you a lot more experience, fun & usefulness.
It depends on what type of application you're developing, for serious ones you need at least one device to test it on. For complex applications you would need a range of devices, for example with or without hardware keyboard, different navigational button etc. For basic, simple applications you'll probably do fine with just the emulator.
I would imagine with games you would definitely need to test on real devices.
Thanks to you all. I am going to get HTC Legend and test it, so that I can hope that my apps can be used by others :)
You guys suggest me HTC Desire or HTC Legend?