The problem today is the lack of research being done on what application settings users prefer and the lack of default setting choices. Settings customization is generally limited in applications with the only choices being default settings or slight alterations of them. Users may also realize that when they reinstall an application that there is no easy way to get back to the previous settings they were using. With the mass population of web applications, people today are also expecting to be able to access their settings from any computer. There is a better way to have an application's settings, and the goal of this work is to provide the necessary tools to reach it. Settings systems such as Gnome's Gconf or the Windows registry are good for storing complex settings, although it's not easy for users to change the settings and it's not immediately obvious how the application behavior is influenced by the settings. The key problem with current approaches, though, is that they provide only a single default configuration, and often a very limited one, for all users.
This section provides background information on what application settings are and why it is important to personalize them. Settings are stored configurations in an application that allow the user to customize the application to their liking. Settings can play a big role in how satisfied a user is with an application and can be crucial in an application's success. There are various different application settings that a user can change in many different applications, a few popular settings include language, theme, background color, text size, and font style. Settings can be stored in many different ways, one of the most common ways is using a configuration file. Data in a configuration file can be easily modified by the user or the application and is a great way to keep user-specific application settings.
In this example clicking the language preference will start the Preferences2 activity. This activity could be a normal user facing preferences screen but it can also be a screen just for changing the setting in question. This is particularly useful for settings with complex dependencies or setting where it is not necessarily appropriate to set them directly from the user touching a UI control.
<PreferenceScreen> <Preference android:title="title_language" android:summary="summary_language"> </Preference> </PreferenceScreen>
Settings on a Menu Many applications have a menu of some sort. Adding a settings item on the menu which brings up the settings screen is easy to do and intuitive for the user to understand. To do this, simply start an Activity from your PreferenceActivity when a particular preference is selected. You can store plain preferences in a special type of preference called an Intent preference. When the user clicks this type of preference it will fire the intent associated with the preference. You can add an intent preference in XML like this:
Once the Settings API has been used to add a settings screen, how do users actually get to the settings? There are several common techniques:
You can modify general preferences using the Preferences.tabPage in step 2 of creating the HelloWorldDemo application. Just as with customizing preferences for a single instance, you can specify that an array of default preference values should be loaded from a properties file. The properties file should contain default values for preference settings. This is your backup method to specify preference default values when you are unable to supply the usual recommended hardcoded defaults within your application. Hardcoded defaults are recommended to ensure that sensible preference default values always exist when your application is first executed. The actual file name of the properties file containing preferences is flexible and need not be hardcoded, see the java.util.Properties API to determine how to do so. A reasonable place to load the properties file is in a custom method within the Preferences subclass for the set of preferences being loaded. A Preferences object for a set of preferences can be obtained using Preferences.userNodeForPackage(Class), and this Preferences object can be passed to a custom Load method to load its specific preferences from the properties file. Note that with multiple sets of preferences being loaded into different Preferences objects, the method Preference.node(String) can be used to obtain Preference objects for hierarchical preference organization under a single root. This allows you to implement the hierarchical organization of preferences described in the previous section. To reference back to the structure in the previous section, each set of preferences being loaded into the HelloWorldDemo application is specified as a separate Properties file. A Properties file contains information representing configuration data, and each Properties file in this case should be a loadable default state for a set of Preferences. For instance, there might be separate Properties files for default stylistic set of preferences and programmatic set of preferences for HelloWorldDemo. An alternative method of specifying the default preference values is to store an XML document for each set of preferences, and load the default values from the XML using the Preferences API method Preferences.importPreferences. This method is only recommended when an XML file format is already in use for storing program configuration data. Once you have default preferences loaded from a file or hardcoded into your application, the application should directly associate the default preference settings with the actual settings that the application uses. As stated in the previous section, the preference setting exists as a key-value pair within a node.
Customization can generally be achieved in a global way through user-specific options on each specific application element or more elegantly through integration with existing operating system settings. This setting can then be distributed across all applications running on that platform. Note that application elements are sometimes written specifically for a single customization option. For example, HTML authoring using a WYSIWYG editor whose output varies depending on display customizations may require different custom view options.
Disabling images can be necessary for users on slow internet connections. There are also vision-impaired users who use screen reading software. An integrated font size option allows such users to set a comfortable font size before opening specific features such as reports in their relevant viewers. Different color schemes can also be essential. For example, a power user may need to toggle to a high contrast black and white mode to more clearly distinguish cell data in a table.
Display setting requirements vary greatly depending on the visual level and mobility of the user. Customization of display options needs to be done in such a way as to enable a user to more productively utilize the application.
A more sophisticated approach is to store user settings on a web server and load these settings to the client application on demand. To accomplish this, the application can write the user's individual settings to a database (a process beyond the scope of this paper), associating the settings with the user's login ID. Then, upon the user's next visit to the application, the application can use web-based scripting techniques to read the user's individual settings from the database and apply these settings to the client application. This approach is suitable for web-based applications.
The simplest way to store user settings is in an .ini file. Upon exiting the application, the application can write the user's individual settings to an .ini file. Then, upon a subsequent visit, the application can read in the user's individual settings from the .ini file. This is a straightforward approach and is suitable for small applications or applications with a limited number of customizable settings.
To begin with, an application should allow the user to save customized settings. As discussed previously, the user should be able to change settings to suit his or her individual needs, and these settings should be saved and then automatically loaded upon the user's next visit to the application. Saving settings can be accomplished in several different ways.