Train your image model
Export the model
Once training is complete, export the model so it can be hosted and loaded by your app.
https://teachablemachine.withgoogle.com/models/XXXXXXXXX/Install the TMIC extension
The TMIC (Teachable Machine Image Classifier) extension by AppInventor community member Taifun bridges Teachable Machine image models directly into App Inventor — no HTML file needed for the classifier logic.
.aix file from the link above and save it to your computer.TMIC.aix.Design the app UI
Add the following components from the palette. Arrange them vertically on the screen.
- WebViewer — displays the live camera feed for the classifier. Set width and height to Fill Parent.
- Button — labelled "Classify Image". Triggers a classification when tapped.
- Label — displays the predicted class name returned from the model.
- Label (second) — displays the confidence percentage of the prediction.
- Tmic (non-visible) — the TMIC extension component you imported in Part 3.
Connect WebViewer & classifier
The TMIC extension uses the WebViewer component to access the device camera and run the TensorFlow.js model. You must link them together and provide your model URL.
In the Designer tab, click on Tmic1 in the component list. In the Properties panel on the right, find the WebViewer property and select WebViewer1 from the dropdown.
Still in the Tmic1 Properties panel, find ModelUrl and paste the link you copied from Teachable Machine.
Switch to the Blocks editor. Add a Screen1.Initialize block that calls Tmic1.initialize, passing your WebViewer1 and the model URL. This loads the model into the WebViewer when the app opens.
when Screen1.Initialize do
call Tmic1.initialize
webViewer: WebViewer1
modelUrl: "https://teachablemachine.withgoogle.com/models/XXXXXXXXX/"
Wire up blocks logic
Add these blocks in the Blocks editor to trigger classification and display results.
when Button1.Click do call Tmic1.classifyVideoFrame
The GotClassification event fires when the model returns a result. It provides the top class name and its confidence score (0–1).
when Tmic1.GotClassification
className confidence do
set Label_Result.Text to join "Result: " className
set Label_Confidence.Text to join "Confidence: "
(join (round (* confidence 100)) "%")
when Tmic1.Error errorMessage do set Label_Result.Text to join "Error: " errorMessage
call Tmic1.classifyVideoFrame call into a Clock timer block set to fire every 500–1000 ms instead of inside the button click.Build & install the APK