Launch the windows settings app
Содержание:
Setting Mock Locations
Start sending scheduled updates (every 2s) for mock location with the specified values by executing:
(API versions 26+):
$ adb shell am start-foreground-service --user 0 -n io.appium.settings/.LocationService --es longitude {longitude-value} --es latitude {latitude-value}
(Older versions):
$ adb shell am startservice --user 0 -n io.appium.settings/.LocationService --es longitude {longitude-value} --es latitude {latitude-value}
Running the command again stops sending the previously specified location and starts sending updates for the
new mock location.
Stop sending new mocklocations and clean up everything (remove the mock location providers) by executing:
$ adb shell am stopservice io.appium.settings/.LocationService
2.4 Add code to set the default values for the settings
To add code to set the default values for the settings, follow these steps:
- Open MainActivity and find the method.
- Add the following statements at the end of the method:
The default values are already specified in the XML file with the attribute, but the above statements ensure that the file is properly initialized with the default values. The method takes three arguments:
- The app , such as .
- The resource ID for the settings layout XML file which includes the default values set by the attribute.
- A indicating whether the default values should be set more than once. When , the system sets the default values only when this method is called for the first time. As long as you set this third argument to , you can safely call this method every time your starts without overriding the user’s saved settings values by resetting them to the default values. However, if you set it to , the method will override any previous values with the defaults.
Changing of system settings
Once installed on a device, you can change the , , and settings through the following commands:
To turn on :
$ adb shell am broadcast -a io.appium.settings.wifi --es setstatus enable
To turn off :
$ adb shell am broadcast -a io.appium.settings.wifi --es setstatus disable
To turn on :
$ adb shell am broadcast -a io.appium.settings.data_connection --es setstatus enable
To turn off :
$ adb shell am broadcast -a io.appium.settings.data_connection --es setstatus disable
To turn on :
$ adb shell am broadcast -a io.appium.settings.bluetooth --es setstatus enable
To turn off :
$ adb shell am broadcast -a io.appium.settings.bluetooth --es setstatus disable
To unpair known :
$ adb shell am broadcast -a io.appium.settings.unpair_bluetooth
To turn on :
$ adb shell am broadcast -a io.appium.settings.animation --es setstatus enable
To turn off :
$ adb shell am broadcast -a io.appium.settings.animation --es setstatus disable
Set particular locale:
$ adb shell am broadcast -a io.appium.settings.locale --es lang ja --es country JP $ adb shell getprop persist.sys.locale # ja-JP $ adb shell am broadcast -a io.appium.settings.locale --es lang zh --es country CN --es script Hans $ adb shell getprop persist.sys.locale # zh-Hans-CN for API level 21+
Local app data
Local app data should be used for any information that needs to be preserved between app sessions and is not suitable for roaming app data. Data that is not applicable on other devices should be stored here as well. There is no general size restriction on local data stored. Use the local app data store for data that it does not make sense to roam and for large data sets.
Retrieve the local app data store
Before you can read or write local app data, you must retrieve the local app data store. To retrieve the local app data store, use the ApplicationData.LocalSettings property to get the app’s local settings as an ApplicationDataContainer object. Use the ApplicationData.LocalFolder property to get the files in a StorageFolder object. Use the ApplicationData.LocalCacheFolder property to get the folder in the local app data store where you can save files that are not included in backup and restore.
Create and retrieve a simple local setting
To create or write a setting, use the ApplicationDataContainer.Values property to access the settings in the container we got in the previous step. This example creates a setting named .
To retrieve the setting, you use the same ApplicationDataContainer.Values property that you used to create the setting. This example shows how to retrieve the setting we just created.
Create and retrieve a local composite value
To create or write a composite value, create an ApplicationDataCompositeValue object. This example creates a composite setting named and adds it to the container.
This example shows how to retrieve the composite value we just created.
Create and read a local file
To create and update a file in the local app data store, use the file APIs, such as Windows.Storage.StorageFolder.CreateFileAsync and Windows.Storage.FileIO.WriteTextAsync. This example creates a file named in the container and writes the current date and time to the file. The ReplaceExisting value from the CreationCollisionOption enumeration indicates to replace the file if it already exists.
To open and read a file in the local app data store, use the file APIs, such as Windows.Storage.StorageFolder.GetFileAsync, Windows.Storage.StorageFile.GetFileFromApplicationUriAsync, and Windows.Storage.FileIO.ReadTextAsync. This example opens the file created in the previous step and reads the date from the file. For details on loading file resources from various locations, see How to load file resources.
Настройка общих параметровConfigure general settings
На Портал Azure найдите и выберите Службы приложений, а затем выберите приложение.In the Azure portal, search for and select App Services, and then select your app. В меню слева приложения выберите Конфигурация > Общие параметры.In the app’s left menu, select Configuration > General settings.

Здесь можно настроить некоторые общие параметры для приложения.Here, you can configure some common settings for the app. Для некоторых параметров необходимо выполнить масштабирование до более высокихценовых категорий.Some settings require you to scale up to higher pricing tiers.
- Параметры стека: программный стек для запуска приложения, включая версии языка и пакета SDK.Stack settings: The software stack to run the app, including the language and SDK versions. Для приложений Linux и настраиваемых приложений-контейнеров можно также задать необязательную команду запуска или файл.For Linux apps and custom container apps, you can also set an optional start-up command or file.
-
Параметры платформы: позволяет настраивать параметры для платформы размещения, включая:Platform settings: Lets you configure settings for the hosting platform, including:
- Разрядность: 32-разрядная или 64-разрядная.Bitness: 32-bit or 64-bit.
- Протокол WebSocket: например, для ASP.NET SignalR или Socket.IO.WebSocket protocol: For ASP.NET SignalR or socket.io, for example.
-
Always on: обеспечивает загрузку приложения даже при отсутствии трафика.Always On: Keeps the app loaded even when there’s no traffic. Он необходим для непрерывных веб-заданий или для веб-заданий, запускаемых с помощью выражения CRON.It’s required for continuous WebJobs or for WebJobs that are triggered using a CRON expression.
Примечание
Используя функцию Always On, балансировщик нагрузки клиентского интерфейса отправляет запрос в корень приложения.With the Always On feature, the front end load balancer sends a request to the application root. Не удается настроить конечную точку приложения для службы приложений.This application endpoint of the App Service can’t be configured.
- Версия управляемого конвейера: IIS.Managed pipeline version: The IIS . Если у вас есть устаревшее приложение, для которого требуется более старая версия IIS, задайте классический .Set it to Classic if you have a legacy app that requires an older version of IIS.
- Версия HTTP: значение 2,0 , чтобы включить поддержку протокола HTTPS/2 .HTTP version: Set to 2.0 to enable support for HTTPS/2 protocol.
Примечание
Большинство современных браузеров поддерживают протокол HTTP/2 только через TLS, а для незашифрованного трафика продолжает использоваться протокол HTTP/1.1.Most modern browsers support HTTP/2 protocol over TLS only, while non-encrypted traffic continues to use HTTP/1.1. Чтобы обеспечить подключение клиентских браузеров к приложению по протоколу HTTP/2, обеспечьте безопасность настраиваемого DNS-имени.To ensure that client browsers connect to your app with HTTP/2, secure your custom DNS name. Дополнительные сведения см. в статье Защита настраиваемого DNS-имени с помощью привязки TLS/SSL в службе приложений Azure.For more information, see Secure a custom DNS name with a TLS/SSL binding in Azure App Service.
Сопоставление arr. в развертывании с несколькими экземплярами убедитесь, что клиент направляется на один и тот же экземпляр в течение сеанса.ARR affinity: In a multi-instance deployment, ensure that the client is routed to the same instance for the life of the session. Этот параметр можно установить в значение Off для приложений без отслеживания состояния.You can set this option to Off for stateless applications.
- Отладка: включить удаленную отладку для , ASP.NET Coreили приложений.Debugging: Enable remote debugging for , ASP.NET Core, or apps. Этот параметр автоматически отключается через 48 часов.This option turns off automatically after 48 hours.
- Входящие сертификаты клиентов: требовать взаимной проверки подлинностисертификаты клиентов.Incoming client certificates: require client certificates in mutual authentication.
Organize app data with containers
To help you organize your app data settings and files, you create containers (represented by ApplicationDataContainer objects) instead of working directly with directories. You can add containers to the local, roaming, and temporary app data stores. Containers can be nested up to 32 levels deep.
To create a settings container, call the ApplicationDataContainer.CreateContainer method. This example creates a local settings container named and adds a setting named . The Always value from the ApplicationDataCreateDisposition enumeration indicates that the container is created if it doesn’t already exist.
Clipboard
This action allows to retrieve the text content of the current clipboard
as base64-encoded string.
An empty string is returned if the clipboard cannot be retrieved
or the clipboard is empty.
Remember, that since Android Q the clipboard content can only be retrieved if
the requester application is set as the default IME in the system:
adb shell ime enable io.appium.settings/.AppiumIME adb shell ime set io.appium.settings/.AppiumIME adb shell am broadcast -a io.appium.settings.clipboard.get adb shell ime set com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
СистемаSystem
| Страница «Параметры»Settings page | URIURI |
|---|---|
| СведенияAbout | ms-settings:aboutms-settings:about |
| Дополнительные параметры экранаAdvanced display settings | ms-settings:display-advanced (доступно только на устройствах, поддерживающих расширенные параметры отображения)ms-settings:display-advanced (only available on devices that support advanced display options) |
| Параметры тома и устройства приложенияApp volume and device preferences | MS-Settings: Apps — том (добавлен в Windows 10, версия 1903)ms-settings:apps-volume (Added in Windows 10, version 1903) |
| Экономия заряда аккумулятораBattery Saver | ms-settings:batterysaver (доступно только на устройствах с аккумулятором, таких как планшет)ms-settings:batterysaver (only available on devices that have a battery, such as a tablet) |
| Параметры экономии зарядаBattery Saver settings | ms-settings:batterysaver-settings (доступно только на устройствах с аккумулятором, таких как планшет)ms-settings:batterysaver-settings (only available on devices that have a battery, such as a tablet) |
| Использование аккумулятораBattery use | ms-settings:batterysaver-usagedetails (доступно только на устройствах с аккумулятором, таких как планшет)ms-settings:batterysaver-usagedetails (only available on devices that have a battery, such as a tablet) |
| буфер обменаClipboard | MS-Settings: буфер обменаms-settings:clipboard |
| ОтображениеDisplay | ms-settings:displayms-settings:display |
| Места сохранения по умолчаниюDefault Save Locations | ms-settings:savelocationsms-settings:savelocations |
| ОтображениеDisplay | ms-settings:screenrotationms-settings:screenrotation |
| Дублирование дисплеяDuplicating my display | ms-settings:quietmomentspresentationms-settings:quietmomentspresentation |
| В эти часыDuring these hours | ms-settings:quietmomentsscheduledms-settings:quietmomentsscheduled |
| ШифрованиеEncryption | ms-settings:deviceencryptionms-settings:deviceencryption |
| Фокусировка вниманияFocus assist | ms-settings:quiethoursms-settings:quiethours ms-settings:quietmomentshomems-settings:quietmomentshome |
| Параметры графикиGraphics Settings | ms-settings:display-advancedgraphics (доступно только на устройствах, поддерживающих расширенные параметры графики)ms-settings:display-advancedgraphics (only available on devices that support advanced graphics options) |
| Обмен сообщениямиMessaging | ms-settings:messagingms-settings:messaging |
| МногозадачностьMultitasking | ms-settings:multitaskingms-settings:multitasking |
| Параметры ночного светаNight light settings | ms-settings:nightlightms-settings:nightlight |
| ТелефонPhone | ms-settings:phone-defaultappsms-settings:phone-defaultapps |
| Проецирование на этот компьютерProjecting to this PC | ms-settings:projectms-settings:project |
| Общие возможностиShared experiences | ms-settings:crossdevicems-settings:crossdevice |
| Режим планшетаTablet mode | ms-settings:tabletmodems-settings:tabletmode |
| Панель задачTaskbar | ms-settings:taskbarms-settings:taskbar |
| Уведомления и действияNotifications & actions | ms-settings:notificationsms-settings:notifications |
| Удаленный рабочий столRemote Desktop | ms-settings:remotedesktopms-settings:remotedesktop |
| ТелефонPhone | MS-Settings: Phone (не рекомендуется в Windows 10, версия 1809 и более поздние)ms-settings:phone (Deprecated in Windows 10, version 1809 and later) |
| Питание и спящий режимPower & sleep | ms-settings:powersleepms-settings:powersleep |
| ЗвукSound | MS-Settings: звукms-settings:sound |
| ПамятьStorage | ms-settings:storagesensems-settings:storagesense |
| Контроль памятиStorage Sense | ms-settings:storagepoliciesms-settings:storagepolicies |
How to Replace Bing With Google on the Taskbar
The search function on the Taskbar can search the web in addition to your computer. However, Microsoft has locked this to always use Bing inside Edge.
If you’d rather search in your default browser, here’s how to replace Edge:
- Install a free app called EdgeDeflector and launch it. The app hasn’t been updated since late 2017, but still works fine as of this writing.
- You’ll see a prompt asking what app you want to use. Choose EdgeDeflector, check Always use this app, and hit OK.
- If you dismiss this dialog or it doesn’t appear, you’ll need to configure EdgeDeflector manually. To do this, go to Settings > Apps > Default apps and click Choose default apps by protocol at the bottom. Find the Microsoft-Edge protocol and change it to EdgeDeflector.
Now, the app will run in the background and change Taskbar web searches from Edge to your default browser. However, these searches will still appear inside Bing. If you’d prefer to use Google or another search engine, do the following:
- If you use Chrome, install the Chrometana Pro extension. Firefox users should install Foxtana Pro, a port from the same developer.
- Upon installing, you’ll see instructions for setting your default browser and installing EdgeDeflector, which we’ve already taken care of.
- Click the Chrometana Pro icon at the top-right of your browser and choose Options. Here you can choose whether to redirect all Bing searches or just Cortana ones. You can also change from Google to DuckDuckGo or another search engine.
Opt in to app signing by Google Play
New apps
Step 2: Prepare your release
- Follow the instructions to prepare and roll out your release.
- After you select a release track, configure app signing under the «Let Google manage and protect your app signing key» section.
- Select Continue, which makes the generated key your upload key that you use to sign future releases, or Advanced options, which include:
- Using the same key as another app on your developer account (Option 2).
- Upload an existing app signing key (Option 2, 3, and 4): Choose the export and upload option that works best for you. After you upload your app signing key and its public certificate, you can or continue using the app signing key as your upload key.
Note: You need to accept the Terms of Service and opt in to app signing to continue.
Step 3: Register your app signing key with API providers
If your app uses any APIs, you usually need to register the certificate of the key Google signs your app with for authentication purposes using the fingerprint of the certificate. Here’s where to find the certificate:
- Sign in to your Play Console.
- Select an app.
- On the left menu, select Release management > App signing.
- Copy the fingerprints (MD5, SHA-1, and SHA-256) of your app signing certificate.
Existing apps
Step 1: Enroll in app signing by Google Play
- Sign in to your Play Console.
- Select an app.
- On the left menu, select Release management > App signing.
- If you haven’t already, review the Terms of Service and select Accept.
Step 2: Send your original key to Google and create an upload key
- Locate your original app signing key.
- Sign in to your Play Console.
- Select an app.
- On the left menu, select Release management > App signing.
- Select the export and upload option that best suits your release process and upload an existing app signing key.
Step 3: Create an upload key (optional and recommended)
-
and upload the certificate to Google Play.
- Copy the fingerprints (MD5, SHA-1, and SHA-256) of your app signing certificate.
Step 4: Sign your next app update with the upload key
When you release updates for your app, you need to sign them with your upload key.
- If you didn’t generate a new upload key: Continue using your original app signing key to sign releases before you upload them to Google Play. If you lose your app signing key, you can and register it with Google to continue updating your app.
- If you generated a new upload key: Use your new upload key to sign releases before you upload them to Google Play. After you upload them, Google checks the release for an upload key to verify your identity. IF you lose your upload key, you can .
Extending Child Panes
Custom ViewControllers
For child pane elements (), Apple requires a key that specifies the child plist. InAppSettingsKit allow to alternatively specify and . In this case, the child pane is displayed by instantiating a UIViewController subclass of the specified class and initializing it using the init method specified in the . The selector must have two arguments: an argument for the file name in the Settings bundle and the . The custom view controller is then pushed onto the navigation stack. See the sample app for more details.
Perform Segues
As an alternative to and for child pane elements (), InAppSettingsKit is able to navigate to another view controller, by performing any segue defined in your storyboard. To do so specify the segue identifier in .
When to provide a settings page
Here are examples of app options that belong in an app settings page:
- Configuration options that affect the behavior of the app and don’t require frequent readjustment, like choosing between Celsius or Fahrenheit as default units for temperature in a weather app, changing account settings for a mail app, settings for notifications, or accessibility options.
- Options that depend on the user’s preferences, like music, sound effects, or color themes.
- App information that isn’t accessed very often, such as privacy policy, help, app version, or copyright info.
Commands that are part of the typical app workflow (for example, changing the brush size in an art app) shouldn’t be in a settings page. To learn more about command placement, see Command design basics.
1. Introduction
In the Preference Framework we have four components to cover, they are:
- Preference Activity or Fragment – these host the Preference Screen, displaying your settings. We may use any one (Activity or Fragment) as per our requirement.
- Preference XML – a xml file defining your settings items.
- Preference Headers – these are lists of subscreens. An xml file defines the Preference Fragments used for the Headers subscreens.
- Shared Preference Change Listener – listens for any changes in the Shared Preference values.
So, now we have a brief introduction to the Preference Framework. We would move forward by creating the project.
Ease of Access
| Settings page | URI |
|---|---|
| Audio | ms-settings:easeofaccess-audio |
| Closed captions | ms-settings:easeofaccess-closedcaptioning |
| Color filters | ms-settings:easeofaccess-colorfilter |
| Cursor & pointer size | ms-settings:easeofaccess-cursorandpointersize |
| Display | ms-settings:easeofaccess-display |
| Eye control | ms-settings:easeofaccess-eyecontrol |
| Fonts | ms-settings:fonts |
| High contrast | ms-settings:easeofaccess-highcontrast |
| Keyboard | ms-settings:easeofaccess-keyboard |
| Magnifier | ms-settings:easeofaccess-magnifier |
| Mouse | ms-settings:easeofaccess-mouse |
| Narrator | ms-settings:easeofaccess-narrator |
| Other options | ms-settings:easeofaccess-otheroptions (Deprecated in Windows 10, version 1809 and later) |
| Speech | ms-settings:easeofaccess-speechrecognition |
Answer these questions
Question 1
In which file of the DroidCafeWithSettings project do you define the array of entries and the array of values for the ? Choose one:
Question 2
In which file of the DroidCafeWithSettings project do you use the array of entries and the array of values in setting up the , and also set the key and default value? Choose one:
Question 3
How do you set up a settings and a with a for the UI, and still remain compatible with the for backward compatibility with older versions of Android?
- Use a settings activity that extends , a fragment that extends , and a for the UI.
- Change to extend .
- Use a settings activity that extends , a fragment that extends , and a for the UI.
- You can’t use a fragment with a and remain compatible with the .
Devices
| Settings page | URI |
|---|---|
| AutoPlay | ms-settings:autoplay |
| Bluetooth | ms-settings:bluetooth |
| Connected Devices | ms-settings:connecteddevices |
| Default camera | ms-settings:camera (Deprecated in Windows 10, version 1809 and later) |
| Mouse & touchpad | ms-settings:mousetouchpad (touchpad settings only available on devices that have a touchpad) |
| Pen & Windows Ink | ms-settings:pen |
| Printers & scanners | ms-settings:printers |
| Touchpad | ms-settings:devices-touchpad (only available if touchpad hardware is present) |
| Typing | ms-settings:typing |
| USB | ms-settings:usb |
| Wheel | ms-settings:wheel (only available if Dial is paired) |
| Your phone | ms-settings:mobile-devices |
Unicode IME
This input method allows to enter unicode values into text fields using terminal command. The idea is to encode the given unicode string into UTF-7 and then let the corresponding IME to decode and transform the actual input. This helper is also useful for automating applications running under Android API19 and older where method of did not support Unicode properly. The actual implementation is based on the Uiautomator Unicode Input Helper by TOYAMA Sumio.
Use the following commands to enable the Unicode IME:
adb shell ime enable io.appium.settings/.UnicodeIME adb shell ime set io.appium.settings/.UnicodeIME
Смешанная реальностьMixed reality
Примечание
Эти параметры доступны только в том случае, если установлено приложение портала Mixed Reality.These settings are only available if the Mixed Reality Portal app is installed.
| Страница «Параметры»Settings page | URIURI |
|---|---|
| Звук и голосовые функцииAudio and speech | ms-settings:holographic-audioms-settings:holographic-audio |
| СредаEnvironment | MS-Settings: privacy-holographic-средаms-settings:privacy-holographic-environment |
| Отображение гарнитурыHeadset display | MS-Settings: holographic-головной телефонms-settings:holographic-headset |
| УдалениеUninstall | MS-Settings: holographic-управлениеms-settings:holographic-management |
Your Windows 10 Defaults, Your Way
We’ve looked at how to change most of Windows 10’s default apps and behaviors. When your computer works the way you want it to, you’ll be much more productive. Remember to review these settings again after major Windows 10 updates, as they can sometimes change.
Windows 10 has a lot in its Settings menu that we didn’t explore here. To learn more, have a look at our guide to the Windows 10 Settings app and what you must do after installing Windows 10.
Image Credit: realinemedia/Depositphotos
How to Install Windows 10 From an Android Device
A backup copy of Windows 10 is always handy to have around. So it’s helpful to know that you can also install Windows from your Android smartphone.
About The Author
Ben is a Deputy Editor and the Onboarding Manager at MakeUseOf. He left his IT job to write full-time in 2016 and has never looked back. He’s been covering tech tutorials, video game recommendations, and more as a professional writer for over six years.
More About Ben Stegner
Data transfer exemptions
There are some exempt apps and platform services that Intune app protection policy may allow data transfer to and from in certain scenarios. This list is subject to change and reflects the services and apps considered useful for secure productivity.
| App/service name(s) | Description |
|---|---|
| Skype | |
| Device settings | |
| App Store | |
| Native Calendar |
Important
App Protection policies created before June 15, 2020 include tel and telprompt URL scheme as part of the default data transfer exemptions. These URL schemes allow managed apps to initiate the dialer. The App Protection policy setting Transfer telecommunication data to has replaced this functionality. Administrators should remove tel;telprompt; from the data transfer exemptions and rely on the App Protection policy setting, provided the managed apps that initiate dialer functionality include the Intune SDK 12.7.0 or later.
1.2 Add the XML preference and attributes for the setting
- Drag a SwitchPreference from the Palette pane on the left side to the top of the layout, as shown in the figure below.

- Change the values in the Attributes pane on the right side of the layout editor as follows, and as shown in the figure below:
- defaultValue: true
- key: example_switch
- title: Settings option
- summary: Turn this option on or off

- Click the Text tab at the bottom of the layout editor to see the XML code:
- Extract the string resources for the and attribute values to and .
The XML attributes for a preferences are:
- : The default value of the setting when the app starts for the first time.
- : The title of the setting. For a , the title appears to the left of the toggle switch.
- : The key to use for storing the setting value. Each setting has a corresponding key-value pair that the system uses to save the setting in a default file for your app’s settings.
- : The text summary appears underneath the setting.
Privacy
| Settings page | URI |
|---|---|
| Accessory apps | ms-settings:privacy-accessoryapps (Deprecated in Windows 10, version 1809 and later) |
| Account info | ms-settings:privacy-accountinfo |
| Activity history | ms-settings:privacy-activityhistory |
| Advertising ID | ms-settings:privacy-advertisingid (Deprecated in Windows 10, version 1809 and later) |
| App diagnostics | ms-settings:privacy-appdiagnostics |
| Automatic file downloads | ms-settings:privacy-automaticfiledownloads |
| Background Apps | ms-settings:privacy-backgroundapps |
| Calendar | ms-settings:privacy-calendar |
| Call history | ms-settings:privacy-callhistory |
| Camera | ms-settings:privacy-webcam |
| Contacts | ms-settings:privacy-contacts |
| Documents | ms-settings:privacy-documents |
| ms-settings:privacy-email | |
| Eye tracker | ms-settings:privacy-eyetracker (requires eyetracker hardware) |
| Feedback & diagnostics | ms-settings:privacy-feedback |
| File system | ms-settings:privacy-broadfilesystemaccess |
| General | ms-settings:privacy or ms-settings:privacy-general |
| Inking & typing | ms-settings:privacy-speechtyping |
| Location | ms-settings:privacy-location |
| Messaging | ms-settings:privacy-messaging |
| Microphone | ms-settings:privacy-microphone |
| Motion | ms-settings:privacy-motion |
| Notifications | ms-settings:privacy-notifications |
| Other devices | ms-settings:privacy-customdevices |
| Phone calls | ms-settings:privacy-phonecalls |
| Pictures | ms-settings:privacy-pictures |
| Radios | ms-settings:privacy-radios |
| Speech | ms-settings:privacy-speech |
| Tasks | ms-settings:privacy-tasks |
| Videos | ms-settings:privacy-videos |
| Voice activation | ms-settings:privacy-voiceactivation |
Button
InAppSettingsKit adds a element that allows to call a custom action. Just add the following delegate method:
The sender is always an instance of , a subclass. So you can access its view property (might be handy to display an action sheet) or push another view controller. Another nifty feature is that the title of IASK buttons can be overriden by the (localizable) value from (or any other settings store — see below). This comes in handy for toggle buttons (e.g. Login/Logout). See the sample app for details.
By default, Buttons are aligned centered except if an image is specified (default: left-aligned). The default alignment may be overridden.
Extending various specifiers
Subtitles
The key allows to define subtitles for these elements: Toggle, ChildPane, OpenURL, MailCompose, Button. Using a subtitle implies left alignment.
A child pane displays its value as a subtitle, if available and no is specified.
The subtitle can be a localizable String or a Dictionary with localizable subtitles depending on the current value. and are used as keys for boolean toggle values. The dictionary may contain a key to define a subtitle if no key is matching.
Text alignment
For some element types, a attribute may be added with the following values to override the default alignment:
- (ChildPane, TextField, Buttons, OpenURL, MailCompose)
- (ChildPane, Buttons, OpenURL)
- (ChildPane, TextField, Buttons, OpenURL, MailCompose)
Variable font size
By default, the labels in the settings table are displayed in a variable font size, especially handy to squeeze-in long localizations (beware: this might break the look in Settings.app if labels are too long!).
To disable this behavior, add a Boolean attribute with value .
Icons
All element types (except sliders which already have a ) support an icon image on the left side of the cell. You can specify the image name in an optional attribute. The «.png» or «@2x.png» suffix is automatically appended and will be searched in the project. Optionally, you can add an image with suffix «Highlighted.png» or «Highlighted@2x.png» to the project and it will be automatically used as a highlight image when the cell is selected (for Buttons and ChildPanes).
Although the default value for the toggle switch setting has already been set in the attribute (in Step 1.2 of this task), the app must save the default value in the file for each setting when the user first opens the app. Follow these steps to set the default value for the toggle switch:
- Open MainActivity.
- Add the following to the end of the method after the code:
The code above ensures that the settings are properly initialized with their default values. The method takes three arguments:
- The app , such as .
- The resource ID () for the XML resource file with one or more settings.
- A indicating whether the default values should be set more than once. When , the system sets the default values only if this method has never been called. As long as you set this third argument to , you can safely call this method every time starts without overriding the user’s saved settings values. However, if you set it to , the method will override any previous values with the defaults.
2.1 Explore the Settings Activity template
To include the Settings Activity template in an app project in Android Studio, follow these steps:
- Copy the DroidCafeOptionsUp project folder, and rename it to DroidCafeWithSettings. Run the app to make sure it runs properly.
- Select app at the top of the Project > Android pane, and choose New > Activity > Settings Activity.
- In the dialog that appears, accept the Activity Name (SettingsActivity is the suggested name) and the Title (Settings).
- Click the three dots at the end of the Hierarchical Parent menu, and click the Project tab in the Select Activity dialog that appears (refer to the figure below).
- Expand DroidCafeWithSettings > app > src > main > java > com.example.android.droidcafeinput and select MainActivity as the parent activity, as shown in the figure below. Click OK.

You choose as the parent so that the Up app bar button in the Settings Activity returns the user to the . Choosing the parent automatically updates the file to support Up button navigation.
- Click Finish.
- In the Project > Android pane, expand the app > res > xml folder to see the XML files created by the Settings Activity template.
You can open and then add to or customize the XML files for the settings you want:
- : layout for «Data & sync» settings.
- : layout for «General» settings.
- : Layout of headers for the Settings main screen.
- : layout for «Notifications» settings.
The above XML layouts use various subclasses of the class rather than , and direct subclasses provide containers for layouts involving multiple settings. For example, represents a top-level that is the root of a hierarchy. The above files use at the top of each screen of settings. Other subclasses for settings provide the appropriate UI for users to change the setting. For example:
- : A checkbox for a setting that is either enabled or disabled.
- : A dialog with a list of radio buttons.
- : A two-state option that can be toggled (such as on/off or true/false).
- : A dialog with an .
- : A dialog with ringtones on the device.
The Settings Activity template also creates:
- in the folder, which you can use as-is. This is the activity that displays the settings. extends for maintaining compatibility with older versions of Android.
- in the folder, which you use as is. This is a helper class that uses to maintain backward compatibility with previous versions of Android.