settings

Android short screen brightness code!

筅森魡賤 提交于 2019-11-30 15:24:52
Anyone who knows why this code ain't lowering the backlight of my application? Context context = this; Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 255); Applications are no longer allowed to modify the global brightness. Don't use the tricks people have tried to come up with at various points, these use private APIs and will break in various ways across different devices (and are considered security holes that have been closed on more recent versions of the platform). The official API to set the brightness is with WindowManager.LayoutParams

How to open settings from my iPad application (Objective-C) [duplicate]

吃可爱长大的小学妹 提交于 2019-11-30 14:42:58
This question already has an answer here: Access Settings app in iOS 4 answers How to open preferences/settings with iOS 5.1? 4 answers I've tried using: [[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ "prefs: root = General & path = Network"]]; And options trading all you see here: examples But I can not make it work. Apple no longer allows developers to open the Settings application from within their apps (iOS 5.1 and later). EDIT According to @Mike's comment below, this can be done in iOS 8+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString

Monitor Android system settings values

别说谁变了你拦得住时间么 提交于 2019-11-30 14:34:16
I want to watch a system setting and get notified when its value changes. The Cursor class has a setNotificationUri method which sounded nice, but it doesn't work and coding it also feels strange... Thats what I did: // Create a content resolver and add a listener ContentResolver resolver = getContentResolver(); resolver.addStatusChangeListener(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS | ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE, new MyObserver()); // I somehow need to get an instance of Cursor to use setNotificationUri in the next step... Cursor

How to turn on VPN from iOS app? (Private APIs OK)

淺唱寂寞╮ 提交于 2019-11-30 14:11:34
问题 When an iOS Device goes into "sleep mode", even a configured VPN is, unfortunately, turned off. A customer that wants an app for his iPad has to use VPN for security, so anything must be done through VPN. The app has to synchronize a lot, but the iOS device might turn off the VPN by itself. That's why I just need to trigger it again every time i need an internet connection (or keep it alive ). Do any of you guys have anything in mind? Even using Private API is ok (the app will only be

Store simple user settings in Python

∥☆過路亽.° 提交于 2019-11-30 14:06:41
问题 I am programming a website in which users will have a number of settings, such as their choice of colour scheme, etc. I'm happy to store these as plain text files, and security is not an issue. The way I currently see it is: there is a dictionary, where all the keys are users and the values are dictionaries with the users' settings in them. For example, userdb["bob"]["colour_scheme"] would have the value "blue". What is the best way to store it on file? Pickling the dictionary? Are there

Rails application settings?

℡╲_俬逩灬. 提交于 2019-11-30 13:11:42
I am working on a Rails application that has user authentication which provides an administrators account. Within the administrators account I have made a page for sitewide settings. I was wondering what the norm is for creating these settings. Say for example I would like one of the settings to be to change the name of the application name, or change a colour of the header. What I am looking for is for someone to explain the basic process/method - not necessarily specific code - although that would be great! For general application configuration that doesn't need to be stored in a database

Creating iOS-like settings screen

纵饮孤独 提交于 2019-11-30 12:49:37
问题 I have been researching how I can create a settings screen for my app that looks identical to the iOS settings app however I haven't been able to find an iOS 7/8/Swift version. I have a custom designed settings screen currently, however it just doesn't look professional enough and I would like something that looks more 'iOS'. Something like this would be perfect: http://jomnius.blogspot.co.uk/2011/04/easy-way-to-create-settings-view.html but obviously this won't work now. I was hoping someone

backup and restore ALL resharper settings

大兔子大兔子 提交于 2019-11-30 11:24:23
问题 How can I backup and later restore (after a clean install) ALL resharper settings? 回答1: On XP Resharper stores its settings in: %userprofile%\Application Data\JetBrains\ReSharper\[R# Version]\[VS Version] and of Vista/7: %userprofile%\AppData\Roaming\JetBrains\ReSharper\[R# Version]\[VS Version] where [R# Version] is the version of ReSharper installed (e.g. v4.5) and [VS Version] is your Visual Studio version (e.g. vs9.0). Just copy all the files from that folder to backup, and put them back

How to force Android Studio to start with the welcome screen?

非 Y 不嫁゛ 提交于 2019-11-30 10:21:11
问题 is it possible to let Android Studio start into the welcome screen instead of directly loading the last recent project? I´ve not really the fastest pc and I often need to switch between projects, its really annoying sometimes. 回答1: Go to (as of July 25, 2015) File -> Settings -> Appearance & Behavior -> System Settings -> Un-check "Reopen last project on startup" -> Click apply (old version) File -> Settings -> General -> Startup/shutdown -> Reopen last project on startup. Un-Check the

How to enable/disable gps and mobile data in android programmatically?

折月煮酒 提交于 2019-11-30 10:11:54
I want my application to be able to enable/disable gps and mobile data programmatically as there are many apps like tasker, profile flow, lookout extra which can do this so I searched for it but not found any useful example I found the following code but they didn't work. private void setMobileDataEnabled(Context context, boolean enabled) { final ConnectivityManager conman = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); final Class conmanClass = Class.forName(conman.getClass().getName()); final Field iConnectivityManagerField = conmanClass.getDeclaredField(