Facebook open-sources framework for smoother Android apps

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

«Microsoft Surface Studio review: Creativity is a sublime, pricey experience

NEXT ARTICLE

Mingis on Tech: How IT can prep for robots and avoid big cloud gotchas»

Add Your Comment

Most Recent Comments

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.

images

Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.

images

Poll

Should companies have Bitcoins on hand in preparation for a Ransomware attack?