Android sort sqlite query results ignoring case

just wondering if theres a way of sorting the results of a query ignoring case. Cause at the moment fields starting with an upper case letter are sorted and put on top of the list and fields starting with lower case letter are also sorted but are put after the upper case fields.

Thanks —
Mike

  • Prevent Dialog (or DialogFragment) from closing when app goes to background
  • geocoder.getFromLocation function throws “Timed out waiting for server response” exception
  • Maven: Using Java 8 libraries in applications instrumented with retrolambda-maven-plugin and DEX-ed with android-maven-plugin
  • Android with Eclipse - Waiting for HOME ('android.process.acore') to be launched?
  • How to reference from drawable to style
  • How do you install m2e-android-plugin in Eclipse?
  • Related posts:

    How do I enable/disable log levels in Android?
    Multiple Views OnTouch Events
    Force Wi-Fi network for 3rd party apps
    Android Studio create project template for new projects
    How do you programmatically end a call on 2.3+?
    Android Studio How to push to new Repository
  • Can we instantiate an abstract class?
  • Android Pros & Cons: Event Bus and RxJava
  • SQLite Query in non case sensitive alphabetical order
  • Android - different behaviour in release signed build?
  • How to check VPN connection status on Android ICS
  • Google Maps V2 not working in production with correct key
  • 3 Solutions collect form web for “Android sort sqlite query results ignoring case”

    ORDER BY column COLLATE NOCASE;

    See http://www.sqlite.org/datatype3.html#collation

    Convert all entries to lower case for example: select name from table order by LCASE(name)

    LCASE or LOWER (Check documentation)

    On the Android you are given a collation function called LOCALIZED.

    When you specify your column, do the following:

    CREATE TABLE song(…, title TEXT COLLATE LOCALIZED ASC, …)

    It works great. If you have the Android source code, just do a search for “COLLATE” to see all sorts of examples.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.