Friday, June 10, 2011

Re: [android-developers] Re: Alternatives to SQLite for static data

On Thu, Jun 9, 2011 at 9:50 PM, nadam <adam@anyro.se> wrote:
> Thanks. It's no saving and no search. Just query and display. The
> items will be displayed as a ListView and the user can chose two
> different ways to sort the list and filter the list based on specific
> predefined values.
>
> To be more specific, it's a list of around 60 "places" that can be
> sorted by name alphabetically or sorted based on the distance from
> where you are (so some dynamic data too, but no need to save that).
> The filtering can be for instance to only show the places that belong
> to a specific category.

SQLite seems like an overkill.

1) Read it at start to a List that will back your ListAdapter.
2) Use java.util.Collections.sort() to sort your list passing one of 2
different Comparator objects depending on what user has chosen.


Daniel

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment