id2966419dsc0008100605005orig

Facebook open-sources framework for smoother Android apps

Facebook is open-sourcing its Litho framework for smooth UI performance on Android mobile applications.

The framework supports native development and leverages the declarative model used in Facebook's React UI library and the Yoga layout system. Layout operations are decoupled from Android views, which "allows us to move the CPU-intensive measure and layout operations to the background thread, saving milliseconds," said Facebook software engineers Pasquale Anatriello and Marco Cova.

Litho's declarative API frees developers from having to hand-optimize UIs, the engineers said. Components are laid out ahead of time in a background thread and rendered incrementally to improve performance. Facebook already has had a similar offering for Apple iOS mobile development with its ComponentKit framework.

Through Litho, complex views are broken down into smaller pieces, such as text, images, and videos, and are rendered incrementally. This spreads the work across multiple frames and recycles smaller pieces that can be recombined, thus reducing the number of views that have to be created and stored in memory. "Since being used across our apps, Litho has delivered great results, including an improvement in scroll performance of up to 35 percent, better memory behavior with complex lists, and easier-to-test UI code," the engineers said.

Android has addressed rendering and dynamic scrolling through the RecyclerView UI container, which can recycle views, Facebook engineers said. But RecyclerView keeps views in different pools, depending on their type. This results in more views being held in memory while new views are constantly created, affecting memory and performance. A view-flattening capability in Litho reduces the number of views needing to be displayed and saves on memory.

IDG Insider

PREVIOUS ARTICLE

« Five tips and tricks to improve your WhatsApp experience

NEXT ARTICLE

Baidu will share autonomous vehicle technology »
author_image
IDG News Service

The IDG News Service is the world's leading daily source of global IT news, commentary and editorial resources. The News Service distributes content to IDG's more than 300 IT publications in more than 60 countries.

  • Mail

Recommended for You

Trump hits partial pause on Huawei ban, but 5G concerns persist

Phil Muncaster reports on China and beyond

FinancialForce profits from PSA investment

Martin Veitch's inside track on today’s tech trends

Future-proofing the Middle East

Keri Allan looks at the latest trends and technologies

Poll

Do you think your smartphone is making you a workaholic?