-
TokenRefresher Fatal Crash When Using FirebaseUI
FirebaseUI is a very useful collection of UI components for Firebase. It removes some of the complexity of implementing Firebase components by providing ready made UI components that your code can hook into. The FirebaseUI-auth library is used for Firebase Authentication in the Firebase series‘ reference app, as well as various other Firebase dependencies.
-
Centralising Firebase / Google Analytics Screen Tracking Using Android Fragments
Whilst tracking user’s screen views with Firebase / Google Analytics can be very simple to setup, it can easily result in a very messy codebase, with hardcoded strings all over the place. Keeping all of the tracking logic in one place allows an instant overview of all tracked screens, as well as easily checking where a screen is reporting a view. Note that this tutorial is for fragments, activities can already be tracked easily automatically.
-
Filtering Google / Firebase Analytics Traffic By BuildType / Environment On Android
Firebase Analytics / Google Analytics is the most widely used service for analysing traffic, and can be used to track detailed information about how users use your app. However, by default it will track all information, including any logged during development or QA. This may mean that the new page you’re working on seems to have a massive spike in traffic, potentially misleading any marketing efforts.
-
Developing Android Apps With Firebase Realtime Database
Firebase Realtime Database is the more traditional predecessor to Firestore, and is essentially a way to store data as JSON and sync it between all clients / servers. Google have also provided a full comparison.
-
Using Fabric (Answers / Beta / Crashlytics) With App Flavours
Setting up Fabric is usually pretty straightforward, especially as they have a step by step guide, and even an Android Studio plugin that can do it all for you.
-
Adding Callbacks From Fragment To Activity Or Activity To Application In Android
When navigating between components in your Android app, you’ll sometimes want to call back to the component’s parent. If your navigation uses activities, startActivityForResult() is easy to use and works fine. However, if your app is a more modern app and uses fragments, this won’t work, and there is no startFragmentForResult() function! It can also be helpful for the application class to know the result from a specific activity.
-
Fixing Dependency Conflict In OneSignal Android
Whilst following OneSignal’s setup guide for their Android SDK, everything went smoothly until attempting to run the build past our CI (continuous integration) server, CircleCI. I’ve encountered various issues when using custom build flavours with OneSignal before, and expect that was the cause of this issue too.
-
Developing Android Apps With Firebase Cloud Firestore
Cloud Firestore provides an app an invisibly syncing cloud database. This takes away a lot of the complexity of ensuring data is up to date, and has very simple methods for creating, retrieving, updating, and deleting data. It also allows syncing between multiple clients, and managing the database via a web interface or an API.
-
Reducing The Size Of TextView DrawableStart / DrawableEnds Using Styles
Using image files or SVGs at the start / end of a TextView can be an easy way to add icons to menu items, or indicators that clicking the TextView will trigger an action. That being said, it can be tricky to position the drawable correctly, and it may not be possible to easily resize it (especially if it was created by someone else).
-
Displaying a "Power Saving Enabled" Bar Inside Your Android App
If your app uses Android hardware features or otherwise needs to be running most of the time, tools such as power saving mode can limit your app’s freedom. Whilst the mode is great for users, the inconsistent implementation (much better now that Doze mode exists, and power saving is more standardised) often leads to unreliable performance on certain devices. Making users aware of this can prevent giving users a negative impression of your app.