Android settings: unlimited, extensible list of values

I would like to allow the user to enter (an unspecified number) values ​​for the preference of the Android application. Existing examples that come to mind are alarm clock applications that can be found on different smartphones (iPhone, HTC Android, ...), where the user can add an alarm clock. *

Can anyone think of a simple way to present an Android user with an extensible list of editable preference values?

So far I have been thinking:

  • Comma separated values ​​in a simple text field.
  • Limit the user to say 10 values ​​and implement them as 10 editable preference items (EditTextPreference).
  • Create your own addiction for these settings (although I'm still not sure how to do this).

Any other ideas?

Chris

* (additional pleasant ones for use along the lines of the alarm example are: automatic ordering by value / time, way to activate / deactivate certain values, a wheel for selecting numerical values ​​similar to wheels for selecting time and date on iPhone or Android).

+3
source share
1 answer

I would like to allow the user to enter (an unspecified amount) values ​​for the Android application preference.

Why preferences? Why not use a relational database or your own flat file structure (like JSON, CSV)?

, (iPhone, HTC Android,...), . *

, ? , PreferenceActivity.

- Android ?

ListView, . , (, , ). , , .

/

ListAdapter .

/

ListView CHOICE_MODE_MULTIPLE, CheckedTextView. ( ).

iPhone Android

Android " ". , , .

, , , .

+3

Source: https://habr.com/ru/post/1753054/


All Articles