It’s finally here: Mobile Cards for Android. For the past year and a half, Mobile Services has been solving a big problem with a simple solution: moving all the web content you want into an app, all without your organization having to do any coding. This content could be anything: a SuccessFactors pay check, a leave request or even the weather for the day.
Today’s users are used to interacting with their data in native apps tailored for their phones. Mobile browsers aren’t enough anymore, and it isn’t just about pretty, native- looking buttons. Web browsers are limited by a real problem: they’re slow.
Mobile Cards (formerly Content to Go) has been saving iOS users from web browsers for over a year and half. Now, at long last, SAP Cloud Platform’s many Android users can enjoy the same effortless mobilization.
Under the hood, Mobile Cards for Android is similar to its older iOS sibling, but its user interface is pure Android. From floating buttons to Android’s classic two-color palette, the new app uses Material Design’s visual language throughout every screen.
In addition to using Android’s latest graphic design principles, Mobile Cards uses some leading-edge Android engineering. First, RecyclerView. As you might expect, RecyclerView, well, recycles views. If you have a list of ten items and each item is just a couple words of text, you could just maintain ten items in memory all the time, even if all ten don’t fit on screen at once. But what if you have fifty images in a list? Keeping all of those in memory would mean using a fair bit of memory.
Android provides a solution: RecyclerView. Instead of keeping all fifty items in memory, it only keeps the ones on-screen in memory. When a view goes off-screen and another comes on-screen, it reuses the old view with the new view’s data, instead of creating a new view.
RecyclerView is more flexible than ListView and GridView, which it replaces. Developers can use RecyclerView to display a list, a grid or deck of cards; an app could even use RecyclerView to display views in a scrollable spiral. A customizable layout manager controls how views are presented, and RecyclerView handles the recycling and memory management.
Another state-of-the-art framework is Firebase, Google’s backend infrastructure solution. It can give developers everything from backend servers to analytics. Mobile Cards uses it to easily send push notifications to Android users. The Cloud Platform Mobile Service sends messages to Firebase, which sends the messages to Android devices. When the app receives a message, it interprets the message and acts accordingly. This could mean downloading new cards from the server or telling the Android operating system to show the user new notification.
Showing lots of images efficiently isn’t easy; Mobile Cards employs some simple but useful engineering to show a slick custom layout without using too much memory or over- working the rendering thread. Either of these could lead to janky user experience.