In this recipe, we are going to create a simple Android Studio application and add machine learning code to it. For this, you will need to download and install Android Studio. From there, create a new project and follow these steps:
- Upon opening Android Studio, from the Start menu, select + Start a new Android Studio project:
- Then, you will need to select a UI template. In this recipe, we are going to select an empty activity:
- On the next screen, you will see a wizard that gives you the option to give the project a name and select a language for it. For this project, we will be selecting Java as our language:
- With that, a new project will open. Now, we need to import TensorFlow Lite into our project. To do this, go to the build.gradle (Module: app) section under Gradle Scripts:
- In the build.gradle JSON file under the dependencies section, add a reference to TensorFlow Lite (implementation 'org.tensorflow:tensorflow-lite:+'...