1) Is there any special setting/configuration required to enable hot swap debugging on Android?
Example case:
2) Does only the emulator support hot swap? Are there any handsets which also support it?
Hot swapping occurs when the code within an existing method implementation is changed. The new method implementation is used next time it is called by the app.
All it means is that you can make certain changes to your code while in the middle of a debugging session, and have those changes take effect immediately, without having to restart the application.
Hot code swapping is replacing or adding components without stopping or shutting down the system. It is frequently called as hot plugging. In software development, hot swapping is used to upgrade or update the system without interrupting the current running system.
Every time the Android project is built, it's dexed and put into a debug-signed apk that is sent to your phone/emulator. Hence, hotswapping isn't exactly easy to do.
Hotswap is a product of a well-designed JVM, and it makes it possible to exchange classes. On Android, you have Dalvik VM, which does not currently support hot swapping.
I'm guessing the ADT team has this high-ish on their list, though.
EDIT: Even though it has been 2,5 years since this answer, not much has changed. ZeroTurnaround, however, have stuff up their sleeves, and JRebel for Android should give us a much needed method for hot swapping. http://zeroturnaround.com/software/jrebel-for-android/
EDIT2: With the release of Android Studio 2.0 Instant Run enables you to hot swap. Hot swap will i.e. change a class while your app is running.
They also support warm swap, which is doing a lot more than hot swap in terms of messing with your app. Warm swap still leaves your app running. Resource changes will trigger a warm swap.
Watch this talk from Android Dev Summit 2015 for more info: https://www.youtube.com/watch?v=fs0eira2pRY
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With