Become a member

Get the best offers and updates relating to Liberty Case News.

― Advertisement ―

spot_img

26 Work Memes for Employees Just Trying to Survive Until 2026 – FAIL Blog

'Tis the season to emotionally clock out of work. If CEOs and management can take part in Circle Back Season, furloughing their responsibilities until the...

How to Work Hard

HomeTechibaryshnikov/android-iced-example: Example of building iced for android

ibaryshnikov/android-iced-example: Example of building iced for android

There are NativeActivity and GameActivity examples here.

Based on several other examples:

iced integration example


Pixed second screenshot

You can also run most of the examples from iced.
For this omit the scene rendering part and set the background of the root container.

Watch first
Watch second
Watch third

Text input partially works, unresolved issues:

  • window doesn’t resize on show/hide soft keyboard
  • how to change input language of soft keyboard
  • ime is not supported

Copy/paste and show/hide soft keyboard is implemented by calling Java

Pixel third screenshot

Check android-activity crate for detailed instructions.
During my tests I was running the following command and using android studio afterwards:

export ANDROID_NDK_HOME="path/to/ndk"
export ANDROID_HOME="path/to/sdk"

rustup target add x86_64-linux-android
cargo install cargo-ndk

cargo ndk -t x86_64 -o app/src/main/jniLibs/  build

My setup is the following:

  • archlinux 6.9.6
  • jdk-openjdk 22
  • target api 35

Thanks to android-activity we can already build android apps in Rust, and
key crates such as winit and wgpu also support building for android.
iced doesn’t support android out of the box, but it can be integrated with
existing graphics pipelines, as shown in
integration example.
As a result, it was possible to convert existing example running winit + wgpu to
use iced on top.

Source link