I am using Google photos to back up my all the photos. So in my Samsung galaxy J7 2016 phone, I have turned on auto sync and it is set to use only in wifi. So whenever I connected to a wifi network it automatically uploads all photos to google photos. This is the process. I know you all know that.
My question is that when the power saving mode on, does sync disabled for temporary or I have to on that again in manual after disabling power saving mode or it is automatically on after disabling the power saving?
My question is that when the power saving mode on, does sync disabled
for temporary?
Yes.
Based on the documentation:
In Doze mode, the system attempts to conserve battery by restricting
apps' access to network and CPU-intensive services. It also prevents
apps from accessing the network and defers their jobs, syncs, and
standard alarms.
For the question:
or I have to on that again in manual after disabling power saving mode
or it is automatically on after disabling the power saving?
You don't have to do anything.
As soon as the user wakes the device by moving it, turning on the screen, or connecting a charger, the system exits Doze and all apps return to normal activity.
Even when in doze mode, system has some maintenance windows, during which the pending syncs will be executed.
Related
I 'm developping a continue scan android app, because I have to collect some important info from another device , I have to scan ble device,and never stop, otherwise, I may miss some important info. Is there any way for a android app to continue Bluetooth Low Energy scan,never stop ,scan for a year if the important device don't appear. During the year, my android phone always keep sufficient electricity,but sometimes I will press home button , sometimes I will make Screen Off (not power off ,just make screen off).
Modern Android has implemented various battery saving measures which will prevent you from continuous data collection.
Doze mode is implemented by the Android framework. See: Scanning for Bluetooth LE devices when the phone is in doze mode, don't work. CallBack method doesn't called when doze mode
Additionally various device manufacturers have implemented their own battery savings systems which will kill your app even when you are following Android framework rules. See: https://dontkillmyapp.com/ for details.
I am making an android app which requires WIFI to be always ON even if phone gets locked. Also, power mode selected by user shouldn't make WIFI to turn OFF. For example, if user selects "Power Saving" mode than OS will automatically turn OFF the WIFI which I want to ignore & just keep it ON forever?
Is it achievable?
The only thing that you can do is use WifiLock. This keeps the WiFi radio on when it was already on. However:
It does not override manual user control (e.g., airplane mode)
AFAIK it will not change full Doze behavior, where network access is suspended (though the user could add your app to the battery optimization whitelist)
Some device manufacturers have added more aggressive power management features, and it is possible that WifiLock is ignored for them
Users may get irritated if they feel that you are using an excessive amount of power, and users can express their irritation in a variety of ways, few of which are pleasant
I'm creating an app that took coordinates every minutes and send to the server using service, but when app is in background and mobile is in idle mode it kill my service but when the phone is not in the power saving mode it doesn't kill my service, because of this scenario i have to disable the power saving mode...
Unfortunately you can not do such thing. And after Marshmallow android introduce Doze behavior for battery optimization which was the biggest halt seems in android for user check this out here.
Please read the above link first before approaching further.
And for more information the power saver mode behavior varies device to device. I myself tested in Samsung Grand and lenovo Vibe devices . Some of Devices will not allow services in background and any network access to the application.
You can find work around for the problem in android documentation in above link
Documentation says:
If a user leaves a device unplugged and stationary for a period of time, with the screen off, the device enters Doze mode. In Doze mode, the system attempts to conserve battery by restricting apps' access to network and CPU-intensive services. It also prevents apps from accessing the network and defers their jobs, syncs, and standard alarms.
What exactly stationary mean? Does phone go into Doze if it is stationary in a car that is moving? I'm developing an app that send location update to a server and if phone go into Doze mode while moving in car that can't be done.
Stationary means literally stationary, no gyro activity, screen off, not connected to charger. As far as the car is moving, the phone will not enter Doze mode.
Android developers: Optimizing for Doze and App Standby
It should be noted that Android N has extended doze mode further. Here the device doesn't need to be 'absolutely stationary' for a 'lighter' version of doze - that allows wake locks but restricts network access - to kick in.
The principal is that to truly take advantage of this, android needs to conserve battery if the phone is in a user's pocket where it is 'unused' but may not be stationary.
The original Marshmallow 'deep-doze' is still very much present in N so once the phone is stationary for a good amount of time [screen off + not being charged are already met criteria] it will go into the original doze where wifi scans and gps scans [location updates], wake locks, job schedulers, sync adapters, and network access is restricted.
To answer your question for location updates, android has a fine motion detecting sensor which ensures that the device is stationary w.r.t earth before diving into the deeper version of doze. So for this particular use case you should be good to go but you should still use the newly introduced Job scheduler api for batched updates. I am sure fetching location is one aspect, you want to upload it to your servers as well. Network access is restricted in both versions of doze modes.
references
https://plus.google.com/+AndroidDevelopers/posts/gwA68kaVJQ8
https://www.youtube.com/watch?v=VC2Hlb22mZM
In case of Android M doze mode will not get kicked in if the device is in moving car.
But in Android N, a light doze mode has been introduced that does not require the device to be completely stationary or wait as long to activate.It starts shortly after both the screen is off and the device is not charging, waiting only a couple minutes before applying the restrictions just to make sure the user has stopped using their phone.
In case,phone is Android N it may go into light doze mode.
when android phone is in SLEEP State 0r Locked State What is the state of WIFI ?
is it active or not?
It's depend on application. By default in Sleep mode wifi state is inactive. Application need to take a wifi lock to keep it acive.
It depends on many factors, including those that others have metioned:
In your android settings, wireless settings, advanced settings- there is a wifi sleep policy which can somewhat answer your question.
However, an application (with the appropriate permission) can change this setting or temporarily change it to bypass the setting.
"Sleep" is pretty vague because some consider this when your display is turned off, however a device actually has different levels of sleep, and deep sleep. Deep sleep doesn't kick in as soon as the display is off, and often these rules are referring to deep sleep.
Applications can also obtain a wifi lock (with the appropriate permission) which will wake up the Wi-Fi radio even though the phone is in deep sleep.
Must be active, I've downloaded stuff from the Market place whilst my phone (HTC Desire) has gone to sleep, and the download has finished the next time I unlock (wake) it.