Developing an Android app to use the model

Follow these steps to create a new Android app using the TensorFlow library and the model we built previously:

  1. In Android Studio, create a new Android app named QuickDraw, accepting all the defaults. Then in the app's build.gradle, add compile files('libs/libandroid_tensorflow_inference_java.jar') to the end of dependencies. Create a new assets folder as we did before and drag and drop quickdraw_frozen_long_blacklist_strip_transformed.pb and classes.txt to it.
  2. Create a new Java class called QuickDrawView that extends View, and set the fields and its constructor as follows:
public class QuickDrawView extends View {    private Path mPath;    private Paint mPaint, mCanvasPaint;    private Canvas mCanvas;

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.