Building with Android studio

If you are an Android developer, you are probably using Android Studio. TensorFlow can be built with just a few simple steps using Android Studio directly.

All the Android samples in TensorFlow rely on Bazel (which is the underlying build system that TensorFlow uses to build for Android) under the hood.

In order to get the Android samples to work in Android Studio, you need to do the following:

  1. Alter the build script to let TensorFlow know where Bazel is. You name of this build script is build.gradle and you can find it in tensorflow/examples/android/build.gradle.
  2. Then you just add the sample folder as a new project in Android Studio and then go ahead and build it.

By following the previous two steps, you will get your .apk file out of Android Studio and then you can use it right away on any Android device.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset