O'Reilly logo

Pro Android Apps Performance Optimization by Hervé Guihot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello World

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required