Tag : disable

If you want to develop an Android app to turn on/off GPS you can use the following code snippets. // turn on gps public void turnGPSOn() { Intent intent = new Intent(“android.location.GPS_ENABLED_CHANGE”); intent.putExtra(“enabled”, true); this.ctx.sendBroadcast(intent); String provider = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(!provider.contains(“gps”)){ //if gps is disabled final Intent poke = new Intent(); poke.setClassName(“com.android.settings”, “com.android.settings.widget.SettingsAppWidgetProvider”); poke.addCategory(Intent.CATEGORY_ALTERNATIVE); poke.setData(Uri.parse(“3”)); ..

Read more

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 ..

Read more

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: getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE); This line secures against manual screenshots and automatic screenshots from the ICS recent-tasks history. You ..

Read more