To save energy of my mobile device my app should turn off animation of system operation android. How can I turn off animation of system operation android programmatically? Does there exist some broadcast receiver for listen this action?
I mean that if you want more performance in your android you can go settings ("Menu-Settings-Display-Animation-NO ANIMATIONS")... I want know how do this programmatically...
While I seem to recall that there might have been this option in old versions of Android, this option does not appear in newer ones. For example, my Galaxy Nexus does not have this option.
With respect to controlling window animations programmatically, the only options for those that I see (e.g., ANIMATOR_DURATION_SCALE) are now in Settings.Global as of Android 4.2 and cannot be modified by ordinary SDK apps. You might be able to control them in earlier versions of Android, though it is unclear what settings directly translate into your Settings option.
Moreover, if you have evidence that changing these values will materially "save energy of [your] mobile device", please post it.
Related
KitKat had the Settings > WiFi > Advanced WiFi option to set the priority as shown.
This isn't present on my Nexus Lollipop and Marshmallow devices. I see there is an App available, but I'd like to know if there is some onboard way I missed to manage these, and if not, what the thinking was behind its removal.
This works on my CyanogenMOD 13 device, which I have come to believe should work on Lollipop and Marshmellow devices as well:
In your Wi-Fi settings, tap the overflow icon, select "Saved networks". Tap the overflow icon again, disable "Automatic priority". You can now re-order your networks by dragging the signal icon up or down.
Let me know how/if it works for L & M!
This is not exactly ordered prioritization, however I found I was able to give preference to one SSID over another by using the data usage setting. By setting HomeWiFi as Unmetered and FreeCableProviderWifi as Metered my phone effectively prioritizes my home network. This solved my problem so I hope this solution helps other even if it doesn't directly answer the question
I realize this is an old post, but looking for something else I stumbled upon this:
On a rooted device you can manually edit the wpa_supplicant.conf file, usually stored in data/misc/wifi. Use a standard text editor.
In this file all saved networks are described in structures like
network={
ssid="network-name"
other_key=other_value
priority=priority-value
}
Higher values in priority mean higher priority. Priorities don't have to be unique. Only if you know that you have multiple stored networks for the same location you should consider giving them different priority values like 0 for the least wanted network and 9 for the most wanted one; you get the idea.
Tools:
There are also some tools available for rooted phones that can help you here. One that I use is GravityBox offering a busload of very helpful tweaks and tools for your phone. You need to have the XPosed framework (>> http://repo.xposed.info/) installed to use GravityBox (>> http://repo.xposed.info/module-overview, then search for GravityBox; be sure to pick the version suitable for your Android version)
There are other tools as well but I can't say anything about them. My opinion is: be careful with tools that are abler to fiddle with sensitive data; if they can change priorities they also can read the network passwords stored in wpa_supplicant.conf...
I was trying to achieve this on stock Nougat 7.1.1 on a Nexus 5x. I edited the properties in the /data/misc/wi-fi/wpa_supplicant.conf file using a text editor. It worked perfectly. You need root access to edit this file however.
since Android 4.2 (I guess) there is the new blocking mode feature.
I'd like to toggle (activate/deactivate) this feature from my app. I know that I can change basically everything about sounds via the SDK but I couldn't find a single article about how to toggle blocking mode.
That is not from stock Android. Whatever it is comes from your device manufacturer. You will have to ask them what that is and whether or not there is an API for controlling it that ordinary SDK apps can hold.
I'm tasked with supporting an app that has already been deployed in production but improperly supports the destruction and recreation of Activities. This is most obvious when a user's device is configured by default to always destroy activities that aren't in the foreground.
This app doesn't explicitly set a value; it uses whatever the global default is.
My question is this: what are the common cases in which this setting is going to be enabled? For instance:
Device manufacturer customizes Android such that this setting can be toggled from within the default device settings activity.
Custom Android build (e.g. Cyanogen) has been configured to have it "on" by default.
User downloads some sort of "power tool" allowing him to tweak the default system settings.
How likely are each of these? Are there other common cases I've missed?
Device manufacturer customizes Android such that this setting can be toggled from within the default device settings activity.
There is no customization needed. This is available in the Developer Options area.
Custom Android build (e.g. Cyanogen) has been configured to have it "on" by default.
One hopes that nobody does this.
User downloads some sort of "power tool" allowing him to tweak the default system settings.
Again, this is part of Android, so no "power tool" is needed.
How likely are each of these?
Not very. I'd be surprised if it is more than one device in 10,000. If your app cannot handle this setting (and I suspect that few apps do), and you are worried about it, feel free to check the setting and display something to the user to have them go revert the setting.
ALmost all devices have it in the settings these days- all nexus devices and high end Samsung devices. The user doesn't need a power tool to turn it on in any of those devices.
Since the sdk version 4.2 it seems like it's no longer possible to modify airplane-mode on devices since google has moved this setting to Settings.Global which is read-only.
Has anyone been able to bypass this without and kind of rooting?
My apps primary function is to enable airplane-mode when the screen is turned off, and this stopped working since 4.2.
Just want to double check that my assessment is correct and that my app is dead starting from android 4.2 and above.
References:
http://developer.android.com/reference/android/provider/Settings.Global.html#AIRPLANE_MODE_ON
Just want to double check that my assessment is correct and that my app is dead starting from android 4.2 and above.
Yes. Or, to put it another way, if there is a back-door way to modify this setting, it represents a security hole, which will eventually get closed, much like the enable/disable GPS restriction that has existed for 3+ years.
I know you explicitly ask for a solution without rooting, but if you have a rooted device there is at least the (kind of) official solution to move your app into folder /system/app. Then it is possible to write into Settings.Global:
Settings.Global.putInt(context.getContentResolver(), Global.AIRPLANE_MODE_ON, mode ? 1 : 0);
Have a look of how to toggle airplane mode for 4.2
and how to move your app into /system/app here. I use this for my toggle widget Mini Status (source code link).
I'm developing a peculiar application which need to prevent the user can go out from application Activities, except with the ways I established inside the application. The Clock in tablet status bar for example allows to go in Android Settings, and I want to prevent it... because I need only some "device administrators" can access to android settings and other apps, others people must can only use this app.
There is a SDK solution?
PS I need to restrict capabilities only to device owner to prevent accidentally damage.
Nope nothing within the public APIs will allow you to do this. I understand that there are legit use cases for it, but to have it possible on all devices would create significant security concerns. (i.e. malicious apps could "lock out" users from their own devices.)
The closest you can get is create a replacement home screen that does not give the user the ability to (easily) go anywhere except where you want.
However as you've noticed with the settings in notification bar there are still loopholes around this. Another of such loopholes is many android keyboards contain a button that will take you to settings.
Also the user may still start their device in "safe mode" which would disable your application.
If you wish to implement this and have it be 100% effective you'd have to modify the OS to allow for it.