You are now ready to run the Android application. The screenshots below show an emulator, but you can also use a physical device.

To run the app in Android Studio using an emulator, follow these steps:

  1. Configure the Emulator:
  • Go to Tools > Device Manager, or click the Device Manager icon on the toolbar.
  • Click Create Device to set up a new virtual device, if you haven’t done so already.
  • Choose a device model, such as the Pixel 4, and click Next.
  • Select a system image, such as Android 11, API level 30, and click Next.
  • Review the settings, and click Finish to create the emulator.
  1. Run the App:
  • Make sure the emulator is selected in the device drop-down menu in the toolbar, next to the Run button.
  • Click the Run button, which is a green triangle. Android Studio builds the app, installs it on the emulator, and then launches it.
  1. View the App on the Emulator:
  • Once the app is installed, it automatically opens on the emulator screen, allowing you to interact with it as if it were running on a real device.

Once the application starts, click the Load Image button. It loads a randomly-selected image. Then, click Run Inference to recognize the digit. The application displays the predicted label and the inference time as shown below:

Image Alt Text:Screenshot of Android application showing a handwritten digit image with the Load Image and Run Inference buttons, displaying the model’s prediction and inference time in milliseconds below the digitDigit recognition result showing prediction

Image Alt Text:Screenshot of Android application displaying a different handwritten digit with the inference result, showing how the model correctly identifies the digit and reports the inference time for performance evaluationAnother digit recognition example with timing

In the next step of this Learning Path, you will learn how to further optimize the model.

Back
Next