January 2012
Intermediate to advanced
282 pages
7h 4m
English
As always when introduced to a new framework,your first instinct should be to say “hello” to the world from a RenderScript script. To create a script, simply create a new file in your Android project and call it helloworld.rs. Listing 9–1 shows how we can create a simple function that will output the “Hello, World” string using a simple RenderScript debugging function.
Listing 9–1. “Hello, World” Script
#pragma version(1)
#pragma rs java_package_name(com.apress.proandroid.ch9)
void hello_world() {
rsDebug("Hello, World", 0); // 0 is because we cannot send only a string to the debug output...
}
The first line declares which version of RenderScript your script uses. The second line declares the package name of the Java reflection ...