android-settings

How to open up phones settings page through preferences?

99封情书 提交于 2019-12-11 16:26:28
问题 I am making a settings page for an app and one of the features I want is for the user to change the permissions through the settings page by redirecting to the users phones settings. I am trying to figured out how to do that programmatically. I am wondering if it can be done like the same way as android.intent.action.VIEW through the preference like I show in the example or is there a different procedure I have to follow. <Preference android:title="Example"> <intent android:action="android

How to disable WiFi on Glass for testing?

这一生的挚爱 提交于 2019-12-11 01:55:10
问题 I want to develop a receiver for Google Glass which will detect the WiFi state of Glass and depending on that state show some information to user. The receiver will listen for android.net.wifi.WIFI_STATE_CHANGED so that I can catch the event and after that check the status of the internet. It will not only detect the internet availability but will also show if Glass is timing out when pinging any specific IP address from any apps of glass. I have tested the receiver on another Android device

Open specific Settings-page programmatically

大兔子大兔子 提交于 2019-12-10 21:55:33
问题 Is there any way to, in my app, to redirect a user to a specific settings 'page'? My app works as a lock screen app, so I want to be able to redirect the user directly to the "Lock Screen" section of the Android settings. (Preferably via a button or something similar) 回答1: ACTION_SECURITY_SETTINGS Intent: Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS); startActivity(intent); For complete Settings Intents 回答2: I managed to find the correct answer in an old Stackoverflow-post

Devices without “Apps using Usage Data” or android.settings.USAGE_ACCESS_SETTINGS intent

≯℡__Kan透↙ 提交于 2019-12-10 09:25:11
问题 Background: Android 5 introduced a new UsageStats API that can be used to query time spent with different apps. This API is used in several apps for detecting the current foreground app (as discussed in several questions, like this), but: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant

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

﹥>﹥吖頭↗ 提交于 2019-12-08 23:01:38
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! You can use KeyguardManager - it's isSecureMethod() should return false in Your case. http://developer.android.com/reference/android/app/KeyguardManager.html 来源: https://stackoverflow.com/questions/37194314/how-to-detect-identify-if-device-lock-screen-setting-is-set-to-none

Which intent should open Data Usage screen (from settings)

♀尐吖头ヾ 提交于 2019-12-08 16:55:26
问题 I wish to open the Data Usage screen from an intent. I've searched the android.provider.Settings class for an appropriate intent. Tried : new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS) new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS) Which doesn't lead to the the data usage. I'm well aware of all the links which has this question, but none has a response. How to open System Data Usage Activity in android? Android programming to open Data Usage setting

How to pop up Enable Bluetooth prompt from Google Play Services?

北慕城南 提交于 2019-12-07 11:36:26
问题 Application I'm working on uses both Locations and BLE and if location or bluetooth are disabled I have to ask user to enable them. Latest Google Play Services provides a standard way to do that using LocationSettingsRequest which checks requirements and raises standard popup if changes to settings are required. It works like a charm for location alone but once I add SetNeedBle (true) to LocationSettingsRequest I get a status SETTINGS_CHANGE_UNAVAILABLE . The only my guess was I need to add

vibrate_when_ringing on Android Marshmallow (6.0)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 07:02:34
问题 In my code I have: Settings.System.putInt(this.getContentResolver(), "vibrate_when_ringing", isVibrateWhenRinging ? 1 :0); Using the following permission: <uses-permission android:name="android.permission.WRITE_SETTINGS" /> This was working fine from Jelly Bean (API 16) till Lollipop (API 22). In Android M, I know that for using that permission I need to prompt the user to Settings.ACTION_MANAGE_WRITE_SETTINGS. However, even with that permission turned on, I see the following error: E

How to open and check whether Play Protect is enabled or disabled

ⅰ亾dé卋堺 提交于 2019-12-06 05:52:47
问题 minSdkVersion 18 targetSdkVersion 27 Using below code, I can able to open the Google Settings page. private static final String GOOGLE_SETTINGS_COMPONENT = "com.google.android.gms"; private static final String GOOGLE_SETTINGS_ACTIVITY = ".app.settings.GoogleSettingsActivity"; Intent i = new Intent(); i.setClassName(GOOGLE_SETTINGS_COMPONENT,GOOGLE_SETTINGS_COMPONENT + GOOGLE_SETTINGS_ACTIVITY); try { startActivity(i); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText

open android settings from QT app(com.android.settings)

你说的曾经没有我的故事 提交于 2019-12-06 00:51:23
问题 I have an android application in QT. I would like to call android settings from a button. I used this code in Java : public void usb(View v){ Intent intent = new Intent(); intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings"); startActivity(intent); } Is there a way to call android settings using QT C++? 回答1: QAndroidJniObject makes it possible to create JNI objects from Qt C++ code. For example: to get the activity: QAndroidJniObject activity =