为什么要建立Android源? [英] Why build android source?

查看:193
本文介绍了为什么要建立Android源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,如果我需要建立,我开发一个应用程序的Andr​​oid源。我需要开发一个应用程序来控制用内核的I2C驱动的设备。我可以做到这一点只需使用SDK和NDK?我应该改为使用SDK和NDK从我的Andr​​oid版本?

I was wondering if I need to build the Android source for an application that I am developing. I need to develop an application to control a device using the I2C driver in the Kernel. Can I do this simply using the SDK and NDK? Should I instead use the SDK and NDK from my Android build?

我注意到的SDK没有一个工具目录,当我尝试运行NDK / NDK的构建,我得到了以下错误。

I noticed The SDK does not have a tools directory, and when I try to run ndk/ndk-build I get the following errors.

/ndk/tool​​chains/arm-linux-androideabi-4.4.3/$p$pbuilt/linux-x86/bin/arm-linux-androideabi-gcc:命令未找到结果
  /ndk/tool​​chains/arm-linux-androideabi-4.4.3/$p$pbuilt/linux-x86/bin/arm-linux-androideabi-g++:命令未找到

/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: Command not found.

当然有两个特定的Andr​​oid网站: source.android.com developer.android.com 和我了解这些提供的指南。似乎没有要任何建议如何处理您的构建做什么或你为什么会构建源,而不是使用下载的SDK。

Naturally there are two specific Android sites: source.android.com and developer.android.com and I understand the guides provided in these. There doesn't appear to be anything that advises what to do with your build or why you would build the source rather than using the downloaded SDK.

推荐答案

一会重建的Andr​​oid(分别意为内核,用户空间,运行系统,系统应用和工具链)如果需要添加的东西的支持不是在现有的受支持构建和不容易被修改,以支持重建短它们的pre-建文件。

One would rebuild android (variously meaning the kernel, userland, runtime system, system apps, and toolchains) if desired to add support for something not supported in the existing build, and not easily supported by modifications to the pre-built files short of rebuilding them.

支持I2C /配置可能是与内核的功能,如权限,模块加载等,您可能能够实现这一植根设备上,而不重新建设了Android运行时运行时配置的某些方面通过简单地修改某些系统文件,虽然你可能最终不得不编译新内核或至少是一个内核模块/用户空间。

i2c support/configuration is likely to be a feature of the kernel and some aspects of runtime configuration such as permissions, module loading, etc. You may well be able to achieve this on a rooted device without re-building the android runtime/userland by simply modifying some system files, though you may end up having to compile a new kernel or at least a kernel module.

这是不太可能增加支持I2C需要改变SDK或NDK,除非你想尝试,使您的任务正式的API,由于Android本身的一个组成部分。最有可能你最终会加入到Android的安装可以从应用程序中使用反射或应用程序提供的存根组件和常量,而不需要改​​变的是什么支持构建系统的想法引用任何功能。

It is unlikely that adding i2c support would require changing the sdk or ndk, unless you want to try to make a formal API for your task as an integrated part of android itself. Most likely whatever capabilities you end up adding to the android installation can be referenced from an app using reflection or app-supplied stub components and constants, rather than needing to change the build system's idea of what is supported.

这篇关于为什么要建立Android源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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