[android-developers] Re: store string array in database

2010-12-27 Thread pramod.deore
Thank you Sir. On Dec 27, 4:41 pm, Mark Murphy mmur...@commonsware.com wrote: Option #1: Use an INTEGER column and bit positions for the different days Option #2: Serialize the strings into a comma-separated list or similar structure and store the result in a TEXT column On Mon, Dec 27,

Re: [android-developers] Re: store string array in database

2010-12-27 Thread Frank Weiss
True, you can store a set of weekdays in a single column, but the real question should be what kind of queries would you make regarding that column. Consider if that column may be used in join, where, order by, etc. On Dec 27, 2010 3:49 AM, pramod.deore deore.pramo...@gmail.com wrote: Thank you

[android-developers] Re: store string array in database

2010-12-27 Thread Bret Foreman
I would use an enum for the Weekdays like this enum Weekdays { SUNDAY , MONDAY, TUESDAY, ...} And then store the ordinal in the DB like this: int ordinal_to_store_in_DB = weekday.SUNDAY.ordinal() And retrieve the values from the DB like this: Weekdays day =

Re: [android-developers] Re: store string array in database

2010-12-27 Thread Kristopher Micinski
Would JSON perhaps be a good solution for this? Kris Micinski On Mon, Dec 27, 2010 at 12:09 PM, Bret Foreman bret.fore...@gmail.com wrote: I would use an enum for the Weekdays like this enum Weekdays { SUNDAY , MONDAY, TUESDAY, ...} And then store the ordinal in the DB like this: int

Re: [android-developers] Re: store string array in database

2010-12-27 Thread Kristopher Micinski
You have seven days, is it horribly looked down upon to store a byte and just mask the bits? Probably so, but that's how I'd do it in C :-). Hopefully that doesn't store up too much excitement, kris On Mon, Dec 27, 2010 at 1:32 PM, Kristopher Micinski krismicin...@gmail.com wrote: Would JSON