Over a million developers have joined DZone.

Flow and Mortar: Libraries to Simplify Android Activities and Fragments

· Java Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

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.


The Java Zone is brought to you by Stormpath—a complete, pre-built User Management API. Want to learn how to use JWTs to protect microservices from CSRF and more? Check out this on-demand webinar with our Java Developer Evangelist, Micah Silverman.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}