android-settings

How to enable NightShift/Night Light/Blue Light Filter programmatically in Android?

此生再无相见时 提交于 2020-12-13 04:05:28
问题 I am trying to enable Blue Light Filter programmatically in Android. Is there any API or function in android that can help me enable / disable / schedule Blue Light Filter option? For clarification, the feature is called Night Shift in iPhones, Night Light in Google Pixels and Blue Light Filter in Samsung Galaxy. Also there maybe other names. It reduces blue light emitted from screen so that it is less stressful for eyes to look at the screen and helps to sleep. So far, I have searching on

Highlighting a menu item in system settings

夙愿已清 提交于 2020-08-05 08:22:50
问题 Trying to bring up an unaswered question I found here - How to highlight android setting app menu item? As seen in this video https://www.youtube.com/watch?v=eHXBc5Mmsqs The "Power Shade" menu item is being highlighted once you enter the screen. I am trying to add the same feature to my app, guiding users to an item in the settings menu using this highlight feature. I can't seem to find any information on how to actually implement this, nor do I know if it has a specific name I could search

How to detect/identify if device Lock Screen setting is set to None?

[亡魂溺海] 提交于 2020-01-03 02:50:16
问题 I need to check before enabling my application if the device has no security defined on setting. Can't have set: Pattern, PIN, Password and even Swipe. Does anyone know a way to check if the lock screen setting is not enabled? Alternately, can we check which of the above lock screen settings is enabled? Thanks! 回答1: You can use KeyguardManager - it's isSecureMethod() should return false in Your case. http://developer.android.com/reference/android/app/KeyguardManager.html 来源: https:/

Disabling an app or activity zoom if Setting -> Display -> Display size changed to Large or small

假装没事ソ 提交于 2019-12-30 11:20:08
问题 In my app, I don't want to allow it to resize as its creating design issues. I have tried with android:resizeableActivity="false" in the application tag and the launcher activity tag but it didn't help. 回答1: I have found a solution for it. If system text size changed or Display size set to Large (Above Android Oreo), Your app will behave as normal (No big text and and zoomed views) with below code: Configuration configuration = getResources().getConfiguration(); configuration.fontScale =

Copy-paste is not working in Android Studio on Mac

痴心易碎 提交于 2019-12-30 04:42:08
问题 I am facing a weird issue with Mac version of Android Studio (i.e., I am not able to copy ( ⌘ + C ) and paste ( ⌘ + V ) any text). I have no idea why it is behaving strange like this. My question may be silly, but I have been facing this issue since I started working from Windows to Mac . Any solutions and alternatives would be much helpful for me. I am completely stuck with this issue for the past two days. 回答1: There are several reasons why you could be experiencing this You are using

How to add an application settings in android system settings?

青春壹個敷衍的年華 提交于 2019-12-24 21:57:01
问题 In my application i have a requirement that i want to provide one edit text in the system settings menu to enter URL and my application hit the server based on the user given URL in system setting. Is it possible ? If it is possible please can any one help me to do this. It is possible in IPhone as they are having a setting.Bundle. Do we have any framework in android similar to IOS? Thanks in Advance. 回答1: You can add the intent-filter blew at your activity in manifest.xml, add it will make a

How to get default device assistance app in android by code?

痞子三分冷 提交于 2019-12-24 05:45:19
问题 my phone installed two voice searches: google app and S-voice app. The default app is S-voice app as figure bellow. My question is that how can we get the default voice application using programmingcally in Android 6.0. Thank you in advance This is what I did private boolean isMyAppLauncherDefault(String myPackageName) { final IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN); filter.addCategory(Intent.CATEGORY_HOME); List<IntentFilter> filters = new ArrayList<IntentFilter>();

Safeguard against “a matching Activity may not exist” in android settings

試著忘記壹切 提交于 2019-12-22 05:40:29
问题 The majority of the Activity Actions (used to launch various Settings activities) in the Settings class come with a warning : In some cases, a matching Activity may not exist, so ensure you safeguard against this. So how do I safeguard against this ? try { final Intent i = new Intent(Settings. ACTION_WIRELESS_SETTINGS); // say i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // not sure if needed startActivity(i); } catch (Exception e) { // what should I catch here // I would hate to catch

How to know whether Notifications are enabled or not for an application in android?

房东的猫 提交于 2019-12-18 14:53:39
问题 I've a ListView which has the list of installed applications and for each application, I need to know whether the notifications are enabled or not. Currently I'm using below code to know if the notifications are enabled: appOpsClass = Class.forName(AppOpsManager.class.getName()); Method checkOpNoThrowMethod = appOpsClass.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE, String.class); Field opPostNotificationValue = appOpsClass.getDeclaredField(OP_POST_NOTIFICATION); int value = (int

How to redirect user to Ethernet Settings screen in android programmatically?

霸气de小男生 提交于 2019-12-11 17:13:35
问题 i have some scenarios in which i need to redirect user to some settings in device(rooted device).example i am redirecting user to wifi settings page like below Intent intent = new Intent(Settings.ACTION_WIFI_IP_SETTINGS); intent.putExtra("extra_prefs_show_button_bar", true); startActivity(intent); same way i need to redirect user to ethernet settings page i am including screen shot of that page because some phones not containing ethernet settings some of may not aware. 回答1: I am aware the