10

Kivy App with Flask Example

 3 years ago
source link: https://github.com/DevDungeon/Python-Kivy-Flask-Android-Example
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Kivy App with Flask Example

This is a template application that shows how Flask and Kivy can work together. This example runs on Android. It starts Flask in a background thread and logs incoming requests to a text output on the Android screen.

ALso see these relevant tutorials:

Setup

You need Kivy and Buildozer. You must be on Linux for Android build to work.

python3 -m pip install kivy buildozer

Build, install, and run

Use buildozer to create Android APKs, deploy, and run.

# Build
python3 -m buildozer android debug
# Build and install
python3 -m buildozer android debug deploy
# Build, install, and run
python3 -m buildozer android debug deploy run
# Build, install, and run with log output
python3 -m buildozer android debug deploy run logcat

Get the IP address of the device

python3 -m buildozer -v android adb -- shell ifconfig wlan0

Run curl from Android

Running curl from the Android device can be useful for testing Flask.

python3 -m buildozer -v android adb -- shell "curl localhost:5000"

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK