This is a demonstration of the Slint toolkit. This demo can be executed on various platforms.
To showcase real-time weather data, you will need an application key from https://www.weatherapi.com/. You can inject the API key by setting the WEATHER_API
environment variable. The geographical location for the weather data can be set using the WEATHER_LAT
and WEATHER_LONG
variables. By default, the location is set to Berlin.
You can run the demo on a desktop or embedded Linux environment with the following command:
cargo run -p energy-monitor
Refer to the MCU backend Readme for instructions on how to run the demo on smaller devices like the Raspberry Pi Pico.
To run the MCU-like code on desktop, use the --features=simulator
cargo run -p energy-monitor --no-default-features --features=simulator --release
First, set up your Android environment. Then, you can run the demo on an Android device with the following command:
cargo apk run -p energy-monitor --target aarch64-linux-android --lib
cargo install wasm-pack
cd demos/energy-monitor/
wasm-pack build --release --target web --no-default-features --features slint/default,chrono
python3 -m http.server