本机代码:“一次编写,随处运行” - 可能吗? [英] Native code: "Write once, run everywhere" - is it possible?

查看:94
本文介绍了本机代码:“一次编写,随处运行” - 可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经认为本机代码仅适用于一个平台,您应该重新编写代码以在另一个平台上运行它。

然后我听说了这个Java口号。

我可以为Windows编写本机代码然后在Android上运行吗?



我知道html5等等,但我说的是本机代码。

解决方案

看到我对你回复这个问题的回应。



不,你当然不能在Android设备上运行本机Windows代码。 Android使用Java,但其程序结构非常特定于Android操作系统,所以它不能在其他系统上运行。


No。

本机代码(不是J​​ava) ),为Windows编写,取决于Windows API,Android中不存在。



祝福,

Pablo。

I used to think native code is only for one platform and you should re-write the code to run it on another platform.
But then i heard about this Java slogan.
Can i write native code for Windows and then run it on Android?

I know about html5 and so on, but i am talking about native code.

解决方案

See my response to your repost of this question.

And no, you can certainly not run native Windows code on an Android device. Android uses Java, but its program structure is very specific to the Android OS so it will not run on other systems.


No.
Native code (not Java), written for Windows, depends on the Windows API, that is not present in Android.

Best wishes,
Pablo.


这篇关于本机代码:“一次编写,随处运行” - 可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆