How to turn on/off (enable/disable) GPS in Android

If you want to develop an Android app to turn on/off GPS you can use the following code snippets.


Disable wordpress automatic updates

In some cases it makes sense to disable automatic wordpress updates. For example if you want to have a special release of a running wordpress installation to check plugins or themes with this release. Or if are not ready to update to the latest version of wordpress or you want to update manualy….

The wordpress developers have considered this and you can easily put the following line of code to your wordpress wp-config.php file.

This will disable all wordpress updates including the minor and major core updates.

If you want to enable wordpress only do the minor updates then use the following line.

If you dount know how to do this or you don’t have access too your wp-config.php file, you can use the plugin. The Update Control plugin adds some options to your Settings – General page. It lets you specify how auto-upgrades should function, without the need to specify constants, edit the wp-config.php or add filters.

Note: Only disable automatic wordpress updates if you know, what you are doing. Some updates are needed because of security reasons and if you disable the update function, it can happen, that your wordpress installation is vulnerable.



How to disable Screenshot in Android

Sometimes it can happen, that the app has to prevent android from taking a screenshot of the app. This can make sense if the app is being pushed into the background and/or for security reasons. So use FLAG_SECURE:

This line secures against manual screenshots and automatic screenshots from the ICS recent-tasks history. You still see the application name and icon, but the screenshot is black.

Note: On some android devices FLAG_SECURE can be problematic: Sometimes FLAG_SECURE causes animation problems in screen rotation animation. See – this has been fixed on Android 4.4.