Building custom TensorFlow library for Android

Follow these steps to manually build a custom TensorFlow library for Android:

  1. In your TensorFlow root directory, there's a file named WORKSPACE. Edit it and make the android_sdk_repository and android_ndk_repository look like the following settings (replace build_tools_version and the SDK and NDK paths with your own settings):
android_sdk_repository(    name = "androidsdk",    api_level = 23,    build_tools_version = "26.0.1",    path = "$HOME/Library/Android/sdk",)android_ndk_repository(    name="androidndk",    path="$HOME/Downloads/android-ndk-r15c",    api_level=14)
  1. If you have also worked with iOS apps in the book and have changed the tensorflow/core/platform/default/mutex.h from #include "nsync_cv.h" and ...

Get Intelligent Mobile Projects with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.