WEBVTT

00:00.160 --> 00:02.360
Hello developers, and welcome back.

00:02.400 --> 00:06.320
In this video we're going to start building our Android application.

00:06.360 --> 00:14.680
Open Android Studio, select a new project empty compose activity and name it as car MPG app.

00:14.720 --> 00:19.240
Click finish and wait for Android Studio to configure the project.

00:19.280 --> 00:23.280
The first step is to add TensorFlow SDK.

00:23.520 --> 00:27.760
So open Build.gradle file, scroll down.

00:27.760 --> 00:35.120
And as we did before in the previous application, let's add those TensorFlow dependencies.

00:35.240 --> 00:37.760
Start with implementation.

00:37.800 --> 00:42.000
We need to add TensorFlow Lite and TensorFlow support.

00:42.040 --> 00:50.440
You can get the latest versions of TensorFlow, but since they are very simple you can write like them.

00:50.480 --> 00:54.960
Okay 2.17 which is the most stable one?

00:55.000 --> 01:05.210
There are newer versions of TensorFlow, but actually they made like mistakes with with the with our

01:05.250 --> 01:07.330
apps and with our tests.

01:07.330 --> 01:10.250
So I keep using 2.17.

01:10.250 --> 01:18.570
And as we learned before, we saw that 2.17 is the most stable ones and the newer versions may contain

01:18.570 --> 01:19.130
bugs.

01:19.250 --> 01:27.370
Okay, so till now use this and support 2.00.5 okay.

01:27.530 --> 01:28.250
Let's sync.

01:28.250 --> 01:35.370
Now the second step is to add this file, the Tflite file that we created before.

01:35.530 --> 01:40.170
And we trained the model to create it to our Android studio.

01:40.450 --> 01:47.850
So here inside this app folder create a new others TensorFlow Lite model.

01:47.850 --> 01:56.930
Select the model location which is the desktop and select it car mpg prediction Tflite which will add

01:56.970 --> 02:03.930
build features and dependencies to build the Gradle, the ML binding and the TensorFlow metadata.

02:04.210 --> 02:08.330
Those dependencies and dependencies will be automatically added.

02:08.490 --> 02:13.250
Also, you can add TensorFlow Lite GPU dependencies to build Gradle.

02:13.290 --> 02:15.610
You can select it no problem.

02:15.770 --> 02:26.090
Or you can ensure that you run your application on physical device so there is no need to use GPU.

02:26.370 --> 02:34.850
Because emulators doesn't support GPU in or you need to configure it with higher and advanced settings.

02:34.890 --> 02:37.290
Okay, so for now we are good.

02:37.530 --> 02:41.370
Uh, select automatically add build features and dependencies.

02:41.370 --> 02:46.530
To build Gradle, click Finish and Wait Android studio to configure the project.

02:46.530 --> 02:47.410
And here we go.

02:47.450 --> 02:54.250
This is our ML package that contains the card and pkg tflite file.

02:54.250 --> 02:56.250
And this is our model.

02:56.290 --> 03:04.210
Okay so congratulations we've added TensorFlow and we've added the model to our application.
