简体   繁体   English

如何在本机C ++代码下使用android UI控件

[英]How to use android UI controls under native C++ code

THE QUESTION is how to reuse the android text edit control, which is java, in our software (C++). 问题是如何在我们的软件(C ++)中重用android文本编辑控件,即java。

Here is some background: 这里是一些背景:

My company's gps software is written in c++ (agg for ui rendering), it can run under iOS, Android and WinCE/Windows. 我公司的gps软件是用c ++(用于ui渲染的agg)编写的,可以在iOS,Android和WinCE / Windows下运行。 But for now our main focus is android. 但是目前,我们的主要重点是android。

Now we need a text edit UI element, we are considering using android ui elements instead of reinventing it ourselves. 现在我们需要一个文本编辑UI元素,我们正在考虑使用android ui元素,而不是自己重新发明它。

Thanks. 谢谢。

You cannot directly use GUI elements which are part of the SDK in the NDK. 您不能直接使用NDK中SDK一部分的GUI元素。 You can use OpenGL to draw whatever you need if you need an all c++ app. 如果需要全c ++应用程序,则可以使用OpenGL绘制所需的内容。

You can, however, build a sdk based UI layer on top of your app and use JNI to call your underlying c code. 但是,您可以在应用程序顶部构建基于sdk的UI层,并使用JNI调用基础c代码。 Check out this tutorial for a sample: 查看本教程中的示例:

http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/ http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/

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

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