Google added doze mode to Android 6.0 Marshmallow with an aim to enhance battery life on existing devices. Though the feature is completely different from any previous battery-saving feature that the Android operating system had in the past, it still defers background CPU and network activity for apps. This brings the need to disable doze mode for certain apps to make them continuously run on Android Marshmallow.
The doze mode automatically gets activated when "the device is not plugged in, when the screen is locked and when no motion has been detected for some time". This, however, has a couple of exceptions for high-priority messages through Google Cloud Messaging and time-sensitive tasks. But in all other cases, the mode has the ability to disrupt any of your favourite apps if they are running in the background. Here are steps to disable doze mode for certain apps to make them run continuously.
How to disable doze mode in Android 6.0 Marshmallow
Step 1: Go to Settings, either from the app drawer or from the notification panel.
Step 2: Tap "Battery" from the Settings list and then hit "Battery optimization" option from the top-right menu icon.
Step 3: Select "All apps" from the options to bring the list all the apps on which doze mode is enabled.
Step 4: Choose any of the apps on which you need to disable doze mode.
Step 5: Tap "Don't optimize" and then hit "Done".
App developers have started following necessary steps to make their apps compatible with the doze mode. This would help delivering a smoother experience with the new features on Android Marshmallow.