I’m an iOS developer and I’m considering getting into Android development.
In Objective-C, I’m used to being able to optimize and tune specific hotspots (e.g. image processing) using inline directives and low-level code.
How do I do the same in Android? Is the answer Renderscript? Is Renderscript compatible with all Android devices?
At a minimum, can I specify that certain methods should be inlined to save on procedure calls in extremely, extremely tight loops?
If by “the same” you mean “using inline directives and low-level code”, generally you don’t “do the same”. There is no “
inlinedirective” in Java. You are welcome to use the NDK to add native code to your Android app.Renderscript Compute can be used to improve performance of things that Renderscript Compute is good at, and image processing tends to be one (at least for some types of processing, like filters).
AFAIK it should be available on all Android devices running API Level 11 and higher (a.k.a., Android 3.0+).
No. The Dalvik JIT will detect and optimize such code based on its own internal heuristics.