简体   繁体   English

是否可以在ARC中使用Native C ++代码?

[英]Is it possible to use Native C++ code in ARC?

We want to try to launch our software on Chrome OS using ARC. 我们想尝试使用ARC在Chrome OS上启动我们的软件。 Many parts of our software application are written in C++ and compiled using the Android NDK. 我们的软件应用程序的许多部分都是用C ++编写的,并使用Android NDK进行编译。 Is it possible to launch this kind of application under ARC? 是否有可能在ARC下推出这种应用程序? Is it possible to launch Native applications(or Java + JNI) under ARC? 是否可以在ARC下启动Native应用程序(或Java + JNI)?

Yes, ARM compiled NDK libraries will run on all Chromebooks currently. 是的,ARM编译的NDK库目前将在所有Chromebook上运行。 For ARM machines they run more or less natively. 对于ARM机器,它们或多或少地本地运行。

For non-ARM machines there is a binary translation layer that dynamically converts the code to run on the target machine. 对于非ARM机器,有一个二进制转换层,可动态转换代码以在目标机器上运行。 This layer may not be 100% machine compatible and if you see errors or crashes indicating instructions cannot be translated, or fundamental differences between your app on ARM and x86, you should file a bug: http://goo.gl/megdlG 此图层可能不是100%机器兼容,如果您看到错误或崩溃表明无法翻译指令,或者您的应用程序在ARM和x86之间存在根本差异,则应提交错误: http//goo.gl/megdlG

I am currently using a library in my project called PDFtron. 我目前在我的项目中使用一个名为PDFtron的库。 It contains ".so" files that I have to assume are either c or c++, and they work fine with Java + JNI. 它包含“.so”文件,我必须假设它们是c或c ++,并且它们可以与Java + JNI一起使用。 There doesn't seems to be a lot of information out there about how this all works(and what works or doesn't), so please post your findings. 似乎没有很多关于这一切如何起作用(以及有效或无效)的信息,所以请发表你的发现。

From google spokesperson(taken from arstechnica): 来自谷歌发言人(摘自arstechnica):

"""The app code is all running on top of the Chrome platform, specifically inside of Native Client. In this way the ARC (App Runtime for Chrome) apps run in the same environment as other apps you can download from the Chrome Web Store, even though they are written on top of standard Android APIs. The developers do not need to port or modify their code, though they often choose to improve it to work well with the Chromebook form factor (keyboard, touchpad, optional touchscreen, etc).""" “”应用程序代码全部运行在Chrome平台之上,特别是在Native Client内部。通过这种方式,ARC(适用于Chrome的App Runtime)应用程序在与您可以从Chrome网上应用店下载的其他应用程序相同的环境中运行,即使它们是在标准Android API之上编写的。开发人员不需要移植或修改他们的代码,尽管他们经常选择改进它以适应Chromebook的外形(键盘,触摸板,可选的触摸屏等) “””

In this quote I think the important part is the integration with native client, which is a technology for executing Native code like C and C++ in the browser. 在这篇引文中,我认为重要的部分是与本机客户端的集成,这是一种在浏览器中执行C和C ++等本机代码的技术。

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

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