Feb 10, 2011 Android App Development
On February 2nd, Google gave us a brief preview of one of its new features – Renderscript. though we did not get a lot of info about it then, we certainly have now. R. Jason Sams, an Android engineer, has given us a quick overview on how Renderscript would a boon to Android Developers. The technical details would be coming out later.
Renderscript is a new API targeted at high-performance 3D rendering and compute operations. This has higher performance and a low level API for developers who plan to max out the performance of their app. Jason Sams has also mentioned that developers would have to “work closer to the metal” with this new API. But it provides the developer with 3 primary tools:
A simple 3D rendering API on top of hardware acceleration, a developer friendly compute API similar to CUDA, and a familiar language in C99.
Renderscript has been used in Youtube as well as book apps. Live wallpaper in the Honeycomb tablets has also Renderscript. This involves executing native code but unlike the existing NDK, this is cross platform.
He also gives a brief description of the app development languages which is c99 with extensions. The development language is compiled to a device-agnostic intermediate format during the development process and placed into the application package. When the app is run, the scripts are compiled to machine code and optimized on the device. This eliminates the problem of needing to target a specific machine architecture during the development process.
Renderscript was however, not developed to replace the existing API but just provide “performance-critical code segments where the needs exceed the abilities of the existing APIs.” With Renderscript, simpler scripts will be able to run on GPU while more complex scripts would run on CPU. And the CPU will serve as a fallback to make sure that scripts are always able to run even if a suitable GPU or other accelerator is not present.
This video has been developed by Android Developers to show us how powerful Renderscript can be. This is a simulation of 900 individual particles. This is a brute force physics simulation activated by the pushing of one of the balls, then continued by the activation of gravity from the right side of the video frame.
If you thought that Renderscript is a new born, then think again. Renderscript goes all the way back to Android 2.1 Eclair. Some of the early examples of Renderscripts were Live Wallpapers and 3D application launcher. The Renderscript Graphics provides a new runtime for continuously rendering scenes. This runtime sits on top of HW acceleration and uses the developers’ scripts to provide custom functionality to the controlling Dalvik code. This controlling code will send commands to it at a coarse level like “turn the page” or “move the list”. The commands the two sides speak are determined by the scripts the developer provides. So this is completely customizable.
With Honeycomb, Android developers have moved to 2.0 from GL ES 1.1 as the renderer for Renderscript. This provides new features like 3D model loading, programmable shader support, and more efficient allocation management. This new compiler is based on LLVM and is more efficient than shown in Android versions 2.1 through 2.3.
And the best news is saved for the last: Renderscript API is now Public!
More information on the technical aspects and a sample code would be released shorty.
- Android Development Toolkit released for App Developers by ARM
- Android Developers can test and develop apps for Honeycomb, SDK released.
- Why and how to go for Android Development ?
- Facts about Android Application development
- Android Developers can enable Hardware Accerelation on your Android App.