# Blog

## OpenMP on Android - TLS workaround

In my post about OpenMP on Android, I mentioned that your app will crash if you try to use OpenMP directives or functions on a non-main thread. That can be traced back to the gomp_thread function in libgomp/libgomp.h, and the fact that it returns NULL for threads you create.

## OpenMP on Android

As of revision 9, the Android NDK comes with support for OpenMP.

## Building an Android NDK toolchain

Recently, I've had to build a custom Android NDK toolchain from source. The steps below detail my approach. I used a fresh install of Ubuntu 12.04 64-bit in a virtual machine with 6GB of RAM and a large amount of disk space, in conjuction with NDK r9.

## Native code coverage (Part 2)

After generating coverage data for your code, gcov can be used to create a report that shows the number of times each line is executed. lcov is a graphical front-end for gcov and can also be used. Personally, I much prefer lcov's HTML output, so that's what I'll use here.

## Native code coverage (Part 1)

On the Android platform, code coverage is available using Ant+Emma. However, that only covers Java code, so if your app is composed of native code as well, you'll want another tool. Fortunately, Gcov is one such tool, and is reasonably easy to setup.

## Selective color algorithm

One of the effects offered by PixStack is selective color. The user selects a color, and pixels close to that color are kept, while everything else is grayed out.

## Including FreeImage in your Android project

In the previous post, I showed how you can compile FreeImage for Android. In this post, I'll demonstrate how you can include the resulting FreeImage library in your project.

## Building FreeImage for Android

In the hope that it might be useful for someone else out there, here are the steps that I use to build FreeImage for Android. These instructions were written for FreeImage 3.15.4 and NDK r8d. Using other versions of FreeImage or the NDK build system may require changes.