From 0edad69ab4ec2f2bfce4b85d4e6d5f74f7ba1bb5 Mon Sep 17 00:00:00 2001 From: Joe Fernandez Date: Fri, 13 Sep 2013 12:40:56 -0700 Subject: Update RenderScript docs to include Support Library APIs Added new section to explain how to access the Support Library RenderScript APIs in Eclipse. Change-Id: Ife6e25bcc7b91c39bb399d1ace624e106a3f38bc (cherry picked from commit f82b04d4ecb9450afc8a3679e7178bfa4ca782b8) --- docs/html/guide/topics/renderscript/compute.jd | 83 +++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) (limited to 'docs/html/guide/topics') diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd index 607d16e..14a1682 100644 --- a/docs/html/guide/topics/renderscript/compute.jd +++ b/docs/html/guide/topics/renderscript/compute.jd @@ -10,6 +10,11 @@ parent.link=index.html
  1. Writing a RenderScript Kernel
  2. +
  3. Accessing RenderScript Java APIs +
      +
    1. Setting Up Your Development Environment
    2. +
    +
  4. Using RenderScript from Java Code
@@ -144,9 +149,85 @@ different level of floating point precision:

beneficial on some architectures due to additional optimizations only available with relaxed precision (such as SIMD CPU instructions).

+ +

Accessing RenderScript Java APIs

+ +

When developing an Android application that uses RenderScript, you can access its Java API in + one of two ways. The APIs are available in the {@link android.renderscript} package + on devices running Android 3.0 (API level 11) and higher. These are the original APIs for + RenderScript. The APIs are also available as a Support Library in the + {@link android.support.v8.renderscript} package, which allow you to use them on devices running + Android 2.2 (API level 8) and higher.

+ +

We strongly recommend using the Support Library APIs for accessing RenderScript because they + include the latest improvements to the RenderScript compute framework and provide a wider range + of device compatibility. Using the RenderScript APIs in the Support Library requires specific + setup procedures for your development environment, which is described in the next section.

+ + +

Using the RenderScript Support Library APIs

+ +

In order to use the Support Library RenderScript APIs, you must configure your development + environment to be able to access them. The following Android SDK tools are required for using + these APIs:

+ + + +

You can check and update the installed version of these tools in the + Android SDK Manager.

+ +

+ Note: Use of Support Library RenderScript APIs is not currently supported with + Android Studio or Gradle-based builds. +

+ +

To use the Support Library RenderScript APIs in Eclipse:

+ +
    +
  1. Make sure you have the required Android SDK version and Build Tools version installed.
  2. +
  3. Open the {@code project.properties} file in the root folder of your application project.
  4. +
  5. Add the following lines to the file: +
    +renderscript.target=18
    +renderscript.support.mode=true
    +sdk.buildtools=18.1.0
    +
    +
  6. +
  7. In your application classes that use RenderScript, add an import for the Support Library + classes: +
    +import android.support.v8.renderscript.*;
    +
    +
  8. +
+ +

The {@code project.properties} settings listed above control specific behavior in the Android + build process:

+ + + +

Using RenderScript from Java Code

-

Using RenderScript from Java code relies on the {@link android.renderscript} APIs. Most +

Using RenderScript from Java code relies on the API classes located in the +{@link android.renderscript} or the {@link android.support.v8.renderscript} package. Most applications follow the same basic usage patterns:

    -- cgit v1.1