Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Flow and Mortar: Libraries to Simplify Android Activities and Fragments

DZone's Guide to

Flow and Mortar: Libraries to Simplify Android Activities and Fragments

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

We recently heard about Square's Flow as a solution for Android-induced development headaches, and it's a pretty interesting tool that looks like it could do a lot to speed up some of the uglier parts of Android development. Flow is a library that helps Android developers keep track of what view an app should be showing using view instances, and aims to simplify some of the confusion that came with Android's Activities and Fragments. According to the Square's overview:

[Flow] is a backstack model that knows you likely have to deal both with the device's back button as well as an ActionBar's up button. The things that Flow manages are referred to as "screens," with a lowercase "S" — they're not instances of any particular class. To Flow a screen is a POJO that describes a particular location in your app. Think of it as a URL, or an informal Intent.

Along with Flow, Square has built a library called Mortar that determines what happens when Flow takes you to a new view. 

To see how it all works, Square's overview also includes a walkthrough of building a music player app with album and track screens, complete with explanations of the roles of Flow and Mortar, as well as code samples of implementation.


Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}