I have a textfield for a filter customers action on a mobile device.
I am wondering if I should wait for a few milliseconds before launching my code when the user typed in less then 3 chars, and only execute the code if the text is longer or equal than 3 chars.
The executed code takes longer(sql like syntax on a larger database), and the user sees hang-outs on the listview.
What do you think?
Delaying SQL queries on text changed events is a good idea indeed. We do use this technique throughout Android. We also always make sure to cancel any previous query. For instance, if the user types “ab”, and we post a message to start a query after the user typed “a”, we cancel that message when the user types “b”.