Getting Started with On-Device AI: Setup & Hardware Requirements
English transcription
00:00 – 00:33 | Course Overview & Prerequisites
Welcome back! Before we start building the app, let's quickly go through what you need for this course and how this repository is organized. This course is designed for intermediate React Native developers. You don't need to be an AI expert, but you should already be comfortable with TypeScript, React Hooks, navigation, and running native applications on Android and iOS. We will use those skills throughout the course, especially when we connect the AI features to the mobile app.
00:34 – 01:47 | Hardware & Device Requirements
The most important requirement is a physical device. I strongly recommend using a real Android phone or iPhone—whatever you have—as you follow along. We are going to work with the camera, microphone, local files, and AI inference running directly on the device.
You can use an emulator for layout work and simple UI testing, but it cannot fully represent the behavior or performance of a real device. Also, keep in mind that on-device AI has hardware requirements. Models take up storage—as we have seen in our previous video, it takes up to 2.5 GB—use memory while they are loaded, and can run at very different speeds depending on the device. We tested it on an iPhone 15 and an Android 15 device. A newer phone will usually give you a faster experience, but you don't need the newest device to follow the course. What matters is that you test on real hardware and understand the trade-offs.
01:48 – 02:41 | Course Structure & Model Files
Rather than putting the entire course into one project state, the course is divided into sections. There is a starter section, and then separate sections for model management, text inference, image inference, audio inference, and the final completed application. This makes it easy to follow each lesson step by step. You can begin from the starter project, compare your code with a later section if you get stuck, or jump to a specific stage when you want to review a feature.
You will notice that the AI model files are not committed to the repository; that is intentional. Model binaries can be large—as you saw earlier, 2.5 GB—and they need to be downloaded or imported separately.
02:42 – 04:41 | Creating the React Native Project
Let's create the React Native app. Go to React Native, click Get Started, then click Get started without a framework. We will use this command to create a new React Native app:
npx @react-native-community/cli@latest init onDeviceAINew --version 0.86.0
(If prompted that a template cannot be found for version 0.86, specify the exact version 0.86.0).
It will take some time to create your project and install dependencies for both Android and iOS. Connect your physical Android device from the start. If you have an iPhone, connect the iPhone device as well and try to run the program before proceeding further. You should first focus on these steps and ensure that they are completed perfectly without any errors, meaning you are able to run this bare app on your physical device successfully. I will pause our video here and continue when installation is done.
04:42 – 05:58 | Running on a Physical Device & Wrap-up
Now that the installation is complete, navigate into the created folder:
cd onDeviceAINew
code .
Open a new terminal in VS Code and run:
npm run android
Now we are able to successfully install the app on a physical Android device. Don't skip this step, because the AI library we will add has native dependencies, so we need a working React Native build before we begin integrating it. If the starter app does not run, take the time to solve that problem now.
Once it is working, you are ready for the next lesson where we will begin setting up the model lifecycle. If you are still stuck, go to the resources section, download the zip file for this specific lecture, and try to run it.
udemy-on-device-ai-lect02.zip
251 KB • Pro Member Vault