blinc_platform_android
Part of the Blinc UI Framework
This crate is a component of Blinc, a GPU-accelerated UI framework for Rust. For full documentation and guides, visit the Blinc documentation.
Android platform implementation for Blinc UI.
Overview
blinc_platform_android provides native Android integration using the NDK, including activity lifecycle, touch input, and GPU rendering via Vulkan.
Supported Platforms
- Android 7.0+ (API level 24+)
- ARM64 and x86_64 architectures
Features
- Native Activity: Full NDK integration
- JNI Bridge: Java interoperability
- Touch Input: Multi-touch support
- Vulkan Rendering: Hardware-accelerated graphics
- Asset Loading: Load from APK resources
- Lifecycle: Proper activity state handling
Quick Start
use android_main;
pub extern "C"
Project Setup
Cargo.toml
[]
= ["cdylib"]
[]
= "0.1"
build.gradle
android
AndroidManifest.xml
Touch Handling
Asset Loading
use AndroidAssetLoader;
let loader = new;
// Load from assets/ directory in APK
let data = loader.load?;
// Check if asset exists
if loader.exists
Lifecycle
android_main;
Building
# Build for Android
# Or using cargo-apk
Requirements
- Android SDK (API level 24+)
- Android NDK r21+
- Rust with Android targets:
- cargo-ndk:
License
MIT OR Apache-2.0