preferences

Android ADT Plugin doesn't show up in Eclipse

旧街凉风 提交于 2019-11-29 09:32:18
I'm using Windows 7 and installed the 64 bit version of Eclipse 3.5.2. I then installed the Android ADT plugin, but when I try to configure it in the Windows > Preferences dialog, the Android Plugin doesn't show up in the left pane. Instead I see DDMS. This prevents me from specifying the location of the Android SDK (unless there is another way) to give me the appropriate templates and such. Someone posted a fix to this that includes setting the permissions of Eclipse, but that didn't work for me. I tried installing the Android Plugin from both online installation (thru the URL install) and

How to clear old preferences when updating Android app?

孤人 提交于 2019-11-29 06:50:11
问题 I have an app on the Google Play market. For various reasons that I won't bother going into, I have changed the type of some of my preferences. For example a preference type was an Integer and in the most recent version it is now a String. I imagine this isn't good practice but unfortunately I had to do it. My concern is that when someone updates to the new version their app will crash as the preference types have changed. For this reason I would like to clear the preferences whenever the app

Best practices for handling user preferences in an iPhone MVC app?

假装没事ソ 提交于 2019-11-29 05:15:18
I'm developing my first iPhone app, and while implementing user preferences, I have a few questions on how to best implement this. Assume the basic MVC pattern: MainView displaying data stored in a Model object; MainViewController handling the app logic. For the options, I have an OptionsView and an OptionsViewController. A RootViewController handles swapping of the Main and Options views. First of all, what about the options data? Would I want to make an NSOjbect-derived class to store them (an OptionsModel)? Or maybe a simple NSDictionary would suffice? Second, who owns the options data?

Update existing Preference-item in a PreferenceActivity upon returning from a (sub)PreferenceScreen

自闭症网瘾萝莉.ら 提交于 2019-11-29 04:08:46
I have a PreferenceActivity with a bunch of (Sub)PreferenceScreens. Each such (Sub)PreferenceScreen represents an account and has the account-username as its title. PreferenceScreen root = mgr.createPreferenceScreen(this); for (MyAccountClass account : myAccounts) { final PreferenceScreen accScreen = mgr.createPreferenceScreen(this); accScreen.setTitle(account.getUsername()); // add Preferences to the accScreen // (for instance a "change username"-preference) ... root.add(accScreen); } As the user enters sub-PreferenceScreen, and edits the account user-name, I want the outer PreferenceScreen

Process the value of preference before save in Android?

最后都变了- 提交于 2019-11-29 03:20:22
问题 I need to crypt my password before save it to local android database. Everything work fine without encryption, I have preferences.xml and so. How can I call a function after I change value of preference (for example, password) ? Here is my code: public class Preferences extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); // Get the custom preference Preference customPref

User preferences file vs App preferences file

断了今生、忘了曾经 提交于 2019-11-29 02:06:40
My android application has two kinds of preferences: 1) I have user preferences defined in res/xml/preferences.xml so that users can manage their preferences with a PreferenceActivity. 2) I'd like to define another file for global configuration preferences of my app. What is the best way to manage my app config preferences? Should I create another XML file with config values or should I specify those config values in strings.xml? What is the best practice for managing config preferences? Pentium10 Preference files are not storead in project's /res/xml/defaults.xml They are stored on the device

Get preferences in AppWidget Provider

泪湿孤枕 提交于 2019-11-29 01:10:43
问题 I seem to be having trouble reading preferences from my AppWidgetProvider class. My code works in an Activity, but it does not in an AppWidgetProvider. Here is the code I am using to read back a boolean: SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); boolean autoreplyon = settings.getBoolean("autoreplyon", false); However, I get the "The method getSharedPreferences(String, int) is undefined for the type widget" error (widget is the name of my AppWidgetProvider class).

ListPreference dependency

谁说胖子不能爱 提交于 2019-11-28 21:03:55
问题 I have a ListPreference which look something like this: <ListPreference android:title="Choose item" android:summary="..." android:key="itemList" android:defaultValue="item1" android:entries="@array/items" android:entryValues="@array/itemValues" /> Then, I have another preference which should only be enabled if "item3" is selected in the ListPreference . Can I somehow accomplish this with android:dependency ? Something like android:dependency="itemList:item3" Thanks! 回答1: The only way you can

Using list preference in Android

天大地大妈咪最大 提交于 2019-11-28 21:01:00
问题 I have a text to speech application where the user can select a language and also select a male or female voice. The problem is that for each language there are different strings used to called the male and female voice but in my preference I only have two options (male and female). <string-array name="Language"> <item>English (US)</item> <item>English (UK)</item> <item>French (France)</item> <item>Spanish (Spain)</item> <item>Italian</item> </string-array> <string-array name="languageAlias">

Where are the Java preferences stored in Windows 7?

纵然是瞬间 提交于 2019-11-28 18:22:35
问题 We use the Java preferences in some of our apps and haven't really noticed this since the utility that makes the calls is fairly old and was written in Windows XP days. But it seems the Java preferences are no longer stored in the registry in Windows 7 - or they are stored somewhere different. I'm expecting it to be in: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs But I don't see it there. What makes it wierder, is that when I run this app: public static void main( final String[] args ) throws