Skip to main content

Testing Flet app on Android

Start building awesome mobile apps in Python using just your computer and mobile phone!

Install Flet app to your Android device. You will be using this app to see how your Flet project is working on Android device.

Get it on Google Play

To get started on your computer you need Python 3.8 or greater installed.

Important

Your Android device and computer must be connected to the same Wi-Fi or local network.

It's recommended to start with the creation of a new virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Next, install the latest flet package:

pip install flet --upgrade

Ensure that Flet has successfully installed and Flet CLI is available in PATH by running:

flet --version

Create a new Flet project:

flet create my-app
cd my-app

Run the following command to start Flet development server with your app:

flet run --android

A QR code with encoded project URL will be displayed in the terminal:

Open Camera app on your Android device, point to a QR code and click URL to open it in Flet app.

Try updating main.py (for example, replace a greeting of Text control) - the app will be instantly refreshed on your Android device.

You can try more complex Flet example from Introduction.

To return to "Home" tab either:

  • Long-press anywhere on the screen with 3 fingers or
  • Shake your Android device.

You can also "manually" add a new project by clicking "+" button and typing its URL.

Quick test

There is "Counter" Flet project hosted on the internet that you can add to Flet app to make sure everything works:

https://flet-counter-test-ios.fly.dev

Check "Gallery" tab for some great examples of what kind of projects could be done with Flet.

Explore Flet examples for even more examples.