简体   繁体   English

Renderscript通过支持库

[英]Renderscript via the support library

Seems to me that android has an android.support.v8 package that contains Renderscript support. 在我看来android有一个包含Renderscript支持的android.support.v8包。 The thing is, this doesn't seem documented anywhere - the support library docs don't say anything about a v8 package, just v4 and v13. 问题是,这似乎没有在任何地方记录 - 支持库文档没有说任何关于v8包,只有v4和v13。

Is that package supported on all devices with API level 8 and above and can it be safely used in production? API级别8及以上的所有设备是否支持该软件包,是否可以安全地用于生产?

它还没有生产质量。

My Android tools contain the files: 我的Android工具包含以下文件:

./build-tools/18.1.0/renderscript/lib/renderscript-v8.jar
./build-tools/18.1.1/renderscript/lib/renderscript-v8.jar

Putting them in the libs/ directory of your project will result in a working build in Eclipse and with ant. 将它们放在项目的libs /目录中将导致在Eclipse和ant中进行工作。

PSA for Googlers: RenderScript is now part of the Android Support Library . 适用于Google员工的PSA: RenderScript现在是Android支持库的一部分 You can use it on Android 2.2+. 您可以在Android 2.2+上使用它。

I have eclipse, android sdk tools 22.6.3, android platform tools 19.0.1 and I set both of these projects API 19 android 4.4.2. 我有eclipse,android sdk工具22.6.3,android平台工具19.0.1和我设置的这两个项目API 19 android 4.4.2。

I was able to compile and run hellocompute(from the samples of android 19) and wants to change it to android support v8 things. 我能够编译并运行hellocompute(来自android 19的示例),并希望将其更改为android支持v8的东西。

following steps works for me: 以下步骤适合我:

1.set android build target to 4.4.2 api 19. 1.将android构建目标设置为4.4.2 api 19。

2.add "rendersrcipt-v8.jar" to libraries in android build path 2.在android构建路径中添加“rendersrcipt-v8.jar”到库

3.in project.properties set things like 3.in project.properties设置的东西

"target=android-19
 renderscript.target=19
 renderscript.support.mode=true
 sdk.buildtools=19.0.3"

4.Comment out the following import lines: 4.评论以下导入行:

import android.renderscript.RenderScript;
import android.renderscript.Allocation;

and import 和进口

import android.support.v8.renderscript.*;

5.clean the project and rebuild. 5.清理项目并重建。

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

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