M
MercyNews
Home
Back

Building Android Apps with Rust and Iced Framework

Hacker NewsDec 22
3 min read
📋

Key Facts

  • ✓ A developer built and updated an Android app example using Rust, Iced, and WGPU.
  • ✓ Integration relies on android-activity, winit, and wgpu for native Android support.
  • ✓ Challenges included fixing text rendering with font loading and adding touch support to widgets.
  • ✓ Other Rust options for Android include xilem, egui, Fyrox, and Bevy.
  • ✓ Similar iOS development is planned, using the same core tools with no visible blockers.

In This Article

  1. Quick Summary
  2. Foundational Tools for Rust on Android
  3. Integrating Iced for GUI Development
  4. Overcoming Challenges in Implementation
  5. Alternatives and Future Directions

Quick Summary#

A developer recently shared their successful experience in building an Android app using Rust and the Iced GUI library, updating the example to the latest releases of Iced and WGPU. This initiative aims to draw more attention to Rust's capabilities on Android, leveraging foundational tools like android-activity, winit, and wgpu. Starting with existing examples from the rust-android-examples repository, which support both NativeActivity and GameActivity, the developer combined these with Iced's integration example for WGPU applications.

Despite Iced's primary focus on desktop and web—where mobile support is not an explicit goal—the integration compiled with minimal errors. Key challenges included fixing text rendering by loading fonts via a specific method and patching widgets for touch support. The result is a working example that builds on prior community efforts. Other Rust-based options for Android include libraries like xilem and egui, as well as game engines such as Fyrox and Bevy. Looking ahead, similar approaches could extend to iOS, with no major blockers identified.

Foundational Tools for Rust on Android#

The journey to building Android apps with Rust begins with essential crates and tools that form the backbone of native development. Developers can rely on android-activity to handle Android's activity lifecycle, integrating seamlessly with winit for window management and wgpu for graphics rendering. These components provide a solid foundation without needing additional frameworks initially.

Existing resources play a crucial role in getting started. The rust-android-examples repository offers a comprehensive set of demonstrations using both NativeActivity and GameActivity, allowing developers to test basic setups quickly. Additionally, examples incorporating egui are available within this repo, showcasing immediate UI possibilities on Android.

Gratitude extends to the contributors behind these tools, including projects like jni-rs for Java Native Interface bindings and various others that enable Rust's interoperability with Android's ecosystem. This collaborative effort underscores the community's commitment to expanding Rust's mobile footprint.

  • android-activity: Manages Android app activities in Rust.
  • winit: Provides cross-platform window handling.
  • wgpu: Delivers WebGPU-based graphics API support.
  • rust-android-examples: Includes practical demos for NativeActivity and GameActivity.

"I'd like to share my experience to attract more attention to Rust on Android."

— Developer

Integrating Iced for GUI Development#

Iced, a cross-platform GUI library primarily designed for desktop and web applications, presents unique opportunities for Android despite mobile not being an explicit goal. Developers have experimented with its integration, as documented in community discussions, revealing pathways to adapt it for touch-based interfaces.

The integration process leverages Iced's example for embedding within wgpu applications. By combining this with android-activity, compilation proceeds smoothly with few errors, enabling a functional GUI layer on top of the core rendering setup.

Key Integration Steps

To achieve this, the basic stack of android-activity, winit, and wgpu serves as the entry point. The Iced integration example then overlays the GUI elements, allowing Rust code to drive both the app logic and user interface.

  1. Start with rust-android-examples to verify the base Android setup.
  2. Incorporate the Iced WGPU integration example.
  3. Compile and test for compatibility on Android devices.

This approach transforms Iced from a desktop-focused tool into a viable option for mobile, building directly on established Rust graphics primitives.

Overcoming Challenges in Implementation#

While the integration of Iced with Android proved straightforward in many aspects, certain hurdles required targeted solutions. A primary issue was the absence of text rendering, which stemmed from font loading mechanisms not optimized for mobile environments.

This was resolved by adopting a font loading technique demonstrated in community resources, ensuring proper display of textual elements within the app. Following this, modifications to select widgets introduced essential touch support, adapting the interface for Android's input methods.

The developer's contribution focused on synthesizing these elements into a cohesive, working example rather than pioneering new features. This assembly of prior work— from font fixes to touch patches—results in a reproducible template for others exploring Rust on Android.

  • Text rendering fix: Implemented via specific font loading method.
  • Touch support: Added through widget patches.
  • Overall role: Combining existing solutions into a functional demo.

These adjustments highlight the iterative nature of porting desktop libraries to mobile, where small tweaks unlock broader usability.

Alternatives and Future Directions 🚀#

Beyond Iced, several Rust-based options facilitate Android app development. Xilem explicitly targets mobile support as a core objective, while egui already accommodates touch interfaces natively. Game engines like Fyrox and Bevy extend their capabilities to mobile platforms, leveraging winit and wgpu for rendering.

Any project built atop these foundational elements can potentially target Android using NativeActivity or GameActivity approaches. Webview-based apps, though outside this discussion, represent another avenue not explored here.

Extending to iOS

Prospects for iOS mirror Android's setup, potentially even simpler in execution. The strategy involves selecting winit, wgpu, and the Iced integration example, then refining as needed—such as the font loading trick—with no apparent obstacles.

Future efforts will prioritize this expansion once time permits, promising cross-platform consistency in Rust mobile development.

In conclusion, the successful Rust and Iced Android app exemplifies the language's maturing ecosystem for mobile. By honoring community tools and addressing integration nuances, developers can innovate efficiently. This progress invites more experimentation, fostering Rust's role in diverse app creation across platforms.

"My role here was to take all the prior work and combine it together in a way that there's a working example."

— Developer

"Once again, thanks to all the people who made it possible and I wish you have a great time building mobile apps with Rust!"

— Developer

Continue scrolling for more

AI Transforms Mathematical Research and Proofs
Technology

AI Transforms Mathematical Research and Proofs

Artificial intelligence is shifting from a promise to a reality in mathematics. Machine learning models are now generating original theorems, forcing a reevaluation of research and teaching methods.

Just now
4 min
186
Read Article
Alex Kurtzman Credits Son for Starfleet Academy's Direction
Entertainment

Alex Kurtzman Credits Son for Starfleet Academy's Direction

In a candid interview, Alex Kurtzman credits his son and his son's friends with providing crucial insight into the younger generation, shaping the tone and approach for the upcoming 'Star Trek: Starfleet Academy' series on Paramount+.

16m
3 min
0
Read Article
Tech Workers Challenge ICE as Executives Stay Silent
Politics

Tech Workers Challenge ICE as Executives Stay Silent

While tech CEOs who once spoke out for social justice now remain quiet, a new wave of employee activism is challenging corporate relationships with ICE, marking a stark shift from the industry's response to George Floyd's killing.

28m
5 min
0
Read Article
California AG Investigates xAI Over Grok Image Generation
Technology

California AG Investigates xAI Over Grok Image Generation

The California Attorney General has opened a formal investigation into Elon Musk's xAI following reports that its Grok chatbot created nonconsensual sexual images of real women and minors.

33m
5 min
0
Read Article
ISS Crew Member Returns to Earth Early Due to Health Issue
Science

ISS Crew Member Returns to Earth Early Due to Health Issue

A planned early departure from the International Space Station has concluded safely. NASA officials emphasize that the return, prompted by a stable medical issue, was a precautionary measure rather than an urgent evacuation.

36m
3 min
0
Read Article
App Economy Defies Trend: Subscriptions Drive Record Revenue
Technology

App Economy Defies Trend: Subscriptions Drive Record Revenue

A surprising new report reveals that while fewer apps were downloaded in 2025, consumer spending hit an all-time high. The shift signals a fundamental change in how users engage with digital services, moving from acquisition to retention.

38m
5 min
0
Read Article
Trump administration faces backlash over Nvidia H200 AI chip sales to China
Politics

Trump administration faces backlash over Nvidia H200 AI chip sales to China

Witnesses and lawmakers at a foreign affairs hearing blasted the Trump administration’s approval for the sale of Nvidia’s H200 AI chips to China and called for it to reverse the decision, as the White House’s top technology adviser defended the move in the administration’s first public testimony discussing the latest export control measures. Allowing China to buy Nvidia’s second most powerful AI chip is a “wrong path” that would “supercharge” Beijing’s military modernisation and damage the US’...

41m
3 min
0
Read Article
Аудиторы сыграют в киберзащите // У бизнеса растет спрос на проверку безопасности хранения и передачи данных
Technology

Аудиторы сыграют в киберзащите // У бизнеса растет спрос на проверку безопасности хранения и передачи данных

Регуляторное давление, растущее число киберинцидентов и устаревшая IT-инфраструктура формируют устойчивый спрос на контроль в сфере кибербезопасности. Основными драйверами рынка, который достиг в 2025 году 25 млрд руб., в дальнейшем станут финансовый сектор, промышленность и телеком, а наиболее востребованными услугами — аудиты защиты данных, приложений и антифрод-систем.

44m
3 min
0
Read Article
China’s EV makers face slowdown in export growth after doubling in 2025
Automotive

China’s EV makers face slowdown in export growth after doubling in 2025

China’s electric vehicle (EV) exports doubled in 2025 amid rising overseas demand for affordable cars and Beijing’s anti-involution campaign. The country – the world’s leading EV manufacturer – sold more than 2.6 million units to overseas markets last year, up 104 per cent from a year earlier, according to data from the China Association of Automobile Manufacturers (CAAM) on Wednesday. Despite persistent trade tensions, Chinese brands were expected to further deepen their presence in overseas...

46m
3 min
0
Read Article
UK Offshore Wind Prices Crush Gas by 40%
Economics

UK Offshore Wind Prices Crush Gas by 40%

A landmark UK offshore wind auction has delivered unprecedented results, with new capacity securing contracts at prices dramatically undercutting fossil fuels. The move signals a pivotal shift in the nation's energy economics and climate strategy.

1h
5 min
18
Read Article
🎉

You're all caught up!

Check back later for more stories

Back to Home