简体   繁体   English

用于Android的C ++或Java?

[英]C++ or Java for android?

I am thinking about picking up android development in my free time. 我正在考虑在空闲时间进行Android开发。 I see that development is possible in Java and C++ but the latter is limited. 我看到Java和C ++中的开发是可能的,但后者是有限的。

I am much more comfortable with C++. 我对C ++感觉更舒服。

So my question is what limitations exist with C++ on Android? 所以我的问题是Android上的C ++存在哪些局限性? Will I be able to develop full apps with it, or will I eventually have to learn Java? 我能用它开发完整的应用程序,还是最终还是要学习Java?

Pick the right tool for the job. 为工作选择合适的工具。 The right tool for android is java, and occasionally c++ if it's really needed. android的正确工具是java,如果真的需要,偶尔会使用c ++。 Android runs on several different CPUs, and you'd be required to deal with fun stuff like compiling for platforms that you can't really test on - at least if you want to make apps for anyone but yourself. Android运行在几个不同的CPU上,你需要处理有趣的东西,比如编译你无法真正测试的平台 - 至少如果你想为除了你自己之外的任何人制作应用程序。

It's all dependent on what you want to do, but the general rule of thumb: 这一切都取决于你想做什么,但一般的经验法则:

C++ is for speed (for example games). C ++用于速度(例如游戏)。

Java is for UI and general Android programming. Java用于UI和一般Android编程。

You cannot code an entire Android application using only C++, the android SDK is written in Java and that is what you will have to use. 您不能仅使用C ++编写整个Android应用程序,Android SDK是用Java编写的,这是您必须使用的。

This said you can still use C++ for heavy stuff. 这说你仍然可以使用C ++来处理繁重的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM