Native code is not necessarily any faster than Java code. Where is your profile data showing that native code could run faster?
Why Java?
- Android runs on many different hardware platforms. You would need to compile and optomize your native code for each of these different platforms to see any real benefits.
- There are a large number of developers already proficient in Java.
- Java has huge open source support, with many libraries and tools available to make developers life easier.
- Java protects you from many of the problems inherent in native code, like memory leaks, bad pointer usage, etc.
- Java allows them to create sandbox applications, and create a better security model so that one bad app can't take down your entire os.
安卓开发刚入门,这回答网上找的。