Android的NDK VS交叉编译?这两个工作,是什么的Andr​​oid NDK那么的需要? [英] Android-Ndk vs Cross-Compile? Both work ,What was the need of Android NDK then ?

查看:129
本文介绍了Android的NDK VS交叉编译?这两个工作,是什么的Andr​​oid NDK那么的需要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以交叉编译的C / C ++应用程序,静态链接的Linux它的图书馆和上android.What运行它是一个Android NDK的需要呢?Android的NDK限制我们的仿生有GNU的一小部分libc.Isn't一个更好的主意,通俗易懂交叉编译应用程序,并通过Android的壳运行它们?是否有任何限制交叉编译,我不能看?此网址:能否Linux应用程序在Android中运行回答我的问题?在一定程度上,但最终让我困惑和不清晰。

I can cross-compile any C/C++ application ,statically link it Linux libraries and run it on android.What was the need of an Android-ndk then ?Android-ndk limits us to bionic which has a small subset of gnu libc.Isn't it a better idea to straightaway cross-compile applications and run them through Android shell?Is there any limitation to cross-compiling that I can't see ? This URL : Can Linux apps be run in Android? answers my question to some extent but eventually leaves me confused and without clarity.

推荐答案

我觉得这是不够的 Android的NDK

而Android NDK是一个配套工具了Android SDK,让你建立你的应用程序性能的关键部分在本地code。 它提供头文件和库,让你共建活动,处理用户输入,使用硬件传感器,访问应用程序资源,更多的,C或C编程的时候++。如果您编写本地code,你的应用程序仍然打包成一个.apk文件和它们仍然是一个虚拟机内部的设备上运行。最根本的Andr​​oid应用程序模式不会改变。

The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change.

NDK的规定:


  • 一组工具,并建立用于生成本地code库文件
    从C和C ++源代码

  • A set of tools and build files used to generate native code libraries from C and C++ sources

嵌入相应的本地库到应用程序的一种方法
可以在Android设备上部署的数据包文件(.apk文件)

A way to embed the corresponding native libraries into an application package file (.apk) that can be deployed on Android devices

一组原生系统头文件和库将支持
在Android平台上的所有未来版本,在Android开始
1.5。使用本机应用程序的活动必须在Android 2.3或更高版本上运行。

A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5. Applications that use native activities must be run on Android 2.3 or later.

这件事,你可以在其他的交叉编译与ARM的工具链没有找到。

This thing you can not find in other cross-compilation with arm toolchain..

这篇关于Android的NDK VS交叉编译?这两个工作,是什么的Andr​​oid NDK那么的需要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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