I recently open-sourced a tool called secrets-gradle-plugin — a Gradle plugin that allows you to pass secrets, such as API keys, securely into an Android app. While the plugin was originally developed for apps that use Google Maps Platform Android SDKs, the problem it solves is generic enough and can be applied to other third party libraries. It works by reading key-values from a secure properties file and exposes those values in two ways. First, as constants in your BuildConfig.java file, so your keys can be programmatically accessed, and second, as injected build variables in your AndroidManifest.xml file, so keys…

This is the 1st part of a 3 part series about how RxJava is used in Pre, a location-based app for checking in and chatting with your best friends. In this first post, I will go over how we used Observables to compose a complex view that displays a list of items, specifically, the dashboard view.

If you are new to RxJava, I recommend starting here. You can also check out a book Angus Huang and I wrote if you would like a more comprehensive learning resource on RxJava.

Note that all of the code samples in this series are…

This is the 1st part of a 3 part series about how RxJava is used in Pre, a location-based app for checking in and chatting with your best friends. In this first post, I will go over how we used Observables to compose a complex view that displays a list of items, specifically, the dashboard view.

If you are new to RxJava, I recommend starting here. You can also check out a book Angus Huang and I wrote if you would like a more comprehensive learning resource on RxJava.

Note that all of the code samples in this series are…

I’m very pleased to announce that a book that Angus Huang and I started writing a few months back, “Reactive Programming on Android with RxJava”, is now published and available on LeanPub! 🎉

Reactive Programming on Android with RxJava

What is RxJava?

RxJava — the Java implementation of ReactiveX — was open sourced and introduced to the developer community by Netflix back in 2013. At Netflix, RxJava had arisen as a need to solve scaling issues created by their previous one-size-fits-all API.

The promise of reactive programming was that it would allow their teams to seamlessly compose complex asynchronous behavior into an easy-to-use API. Using these APIs, their client…

This post was originally published on my Toptal account.

Concurrency and asynchronicity are inherent to mobile programming.

Dealing with concurrency through imperative-style programming, which is what programming on Android generally involves, can be the cause of many problems. Using Reactive Programming with RxJava, you can avoid potential concurrency problems by providing a cleaner and less error-prone solution.

Aside from simplifying concurrent, asynchronous tasks, RxJava also provides the ability to perform functional style operations that transform, combine, and aggregate emissions from an Observable until we achieve our desired result.

By combining RxJava’s reactive paradigm and functional style operations, we can model…

This post was originally published on Toptal under my Toptal account.

If you’re an Android developer, chances are you’ve heard of RxJava. It’s one of the most discussed libraries for enabling Reactive Programming in Android development. It’s touted as the go-to framework for simplifying concurrency/asynchronous tasks inherent in mobile programming.

But… what is RxJava and how does it “simplify” things?

While there are lots of resources already available online explaining what RxJava is, in this article my goal is to give you a basic introduction to RxJava and specifically how it fits into Android development. …

Configuration changes occur in runtime and are caused by various events such as: when keyboard visibility changes, when language changes, or when orientation changes. This in turn causes any visible Activity to be reconstructed once the change finishes. For state to be recovered, it needs to be explicitly tied to Android’s parcelling mechanism via Bundle.

Saving State, The Wrong Way

Upon encountering state loss caused by a configuration change, say on an orientation change, 2 poor solutions are:

  1. Locking the orientation mode
<activity 
android:name=”com.app.app.MainActivity”
android:screenOrientation=”portrait” />

This is an anti-solution and simply prevents the configuration change from occurring. …

Chris Arriola

Developer Relations Engineer at Google | Author of: http://bit.ly/2rb27p0 & http://bit.ly/2O7to5u

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store