In my Android app I want to have an input field with autocomplete. The number of items will be about 300000. The best solution seems to be to put the items into a file (on sdcard), one item per line, each line would have the same number of characters so that I can seek to specific line number. If the user enters something in the text field, I would binary search (via RandomAccessFile) the file and show suggestions.
I want the autocomplete to be super fast (ideally under 100ms but I guess it's impossible), what optimizations I can do?
Update 1: I will convert the users input to lowercase english characters (a-z) with spaces. So 'A/b' would be converted to 'a b' and then searched.
Uodate 2: I now realized I need additional thing - to search for word-starting substrings.