问题
I think, it might be bit early to ask this question. But need your thoughts on this.
I read about ART mode (Android Runttime), which is as follows,
"ART is a new Android runtime being introduced experimentally in the 4.4 release KitKat. This is a preview of work in progress in KitKat. It is available for the purpose of obtaining early developer and partner feedback."
But also read that, Some apps might crash, if switch to ART mode. So, I want to know, whether do I need to consider any design objectives to run my app in ART and DVM mode while programming?
回答1:
Yes, there are some problems you might encounter when blindly assuming your app will be run on Dalvik. So, even though ART is still experimental, therefore shall not be used by normal users, you might want to consider the following points:
- Dynamic Dex loading (like used in the Facebook app) might not be possible at runtime because the AOT compiler might not be available at runtime.
- Therefore, anything that uses runtime Bytecode manipulation, like Clojure, might encounter problems when run on ART.
- According to this thread and some comments on Reddit, Xamarin encounters problems with ART as well.
Basically, anything that relies on Dalvik-specific features is a possible source for crashes.
Update: Apparently, dex loading with ART works fine, by aot-ing the files on disk and caching the compiled versions. Awesome! :)
来源:https://stackoverflow.com/questions/23936538/should-developer-consider-any-design-objectives-for-art-android-runtime-with-r