In the previous post, we walked through Doze and App Standby modes, we mentioned the different types of Doze and when they are activated. We showed all the restrictions that each bring (especially when working with Alarms) and how to dodge them. In this article, we are going to describe briefly how to use sensors in Android. We’ll analyze how they behave under battery optimization modes and we’ll explain some tricks in order to solve such fragmentation issues.
In the last post, we learnt how Android Alarms work. We analyzed the different options, types and methods available and realized that scheduling tasks in Android implies fragmentation issues. In this post, we’ll dive into Doze and App Standby modes, explaining how these two power-saving features work in detail. Furthermore, we’ll go deeper, describing how alarms are affected when devices enter Doze mode and the problems it causes on apps with a strong background component. Stay awake!
In order to prepare the talk, that my friend Raúl and I will give at Codemotion Spain 2016, I decided to write a series of posts explaining how alarms and sensors work and how Doze mode affects their normal behavior. In the talk, we’ll discuss those topics, the problems that we found along the way creating Drivies and how we have solved such fragmentation issues. Don’t miss it! In this first article, we are going to analyze alarms in Android. Let’s go!
First of all I would like to apologize for the delay in releasing the third and final article of the series. I’ve been a bit busy lately, sorry… In the meantime, Clean-Architecture related posts have been appearing (e.g. Hexawhat Architecture?), my friends from Karumi have released two versions of Rosie (their awesome Android framework to create applications following the principles of Clean Architecture), Otto, a library that I use in the sample, was deprecated (no worries, it won’t be a problem) and even Google has even created Android Architecture Blueprints, a collection of samples to discuss and showcase different architectural tools and patterns for Android apps. Nonetheless, I’m pretty sure you’ll learn something, so keep reading ;)
In the last post, we walked through the Clean part, giving a summary of some concepts that you should know if you wish to write well-crafted code. If you want to go more deeper I encourage you to review other principles and patterns that have been explained and discussed for so long, like GRASP and the ones included in the Gang Of Four Design Patterns Book. In this post, we are going to mention some layered architectures, explaining what they have in common and their advantages and disadvantages. Furthermore, we’ll go deeper, describing Hexagonal Architecture and comment some of its potential downsides. So, less talk and more action!
Lately, there are a lot of people in the Android community, talking about Architecture, especially about Clean. That’s good news! I’m pretty sure some of you are familiar with terms like layers, Ports and Adapters, boundaries, etc. but others aren’t.
I’m a Mac user for around 3 years, so I consider myself a relatively new user. I remember well the first days and weeks and I was a bit lost in what apps could be useful for me on a daily basis.