0

I am a new developer and i am working on my first android app. I am making a app for my uncles pool business. The purpose of the app is to allow his workers to record how many chemicals they put in each pool they do every day. I built the app using fire base firestore. Currently the data is being stored under the employees name but I want it to be stored under the customers name. The problem I have is that I am getting the customer name through a basic edit text field. What I need is a text field where when the user starts typing a list of the customer names comes up and they can pick one. This is needed to avoid typos.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Would a spinner work here i never used one before and there are about 500 customers? – anthony huggins Jun 13 '18 at 18:09
  • 1
    you need to use AutoCompleteTextView. Find the good example and it will help you for this issue. – Pragnesh Ghoda シ Jun 13 '18 at 18:09
  • There's no full-text search in Firestore. But you can do prefix matching, so "all names starting with 'anth'". See https://stackoverflow.com/questions/46642641/sql-like-operator-in-cloud-firestore – Frank van Puffelen Jun 13 '18 at 18:09
  • You can use this link : http://coderzpassion.com/android-working-with-autocompletetextview/ – Pragnesh Ghoda シ Jun 13 '18 at 18:11
  • If you are looking for a full-text search in Firestore, please take a look [here](https://stackoverflow.com/questions/49596610/is-it-possible-to-use-algolia-query-in-firestorerecycleroptions/49607796). – Alex Mamo Jun 13 '18 at 18:22
  • If you are looking for a simple search query, please take a look [here](https://stackoverflow.com/questions/50682046/applying-word-stemming-in-searchview-for-fetch-data-from-firebase-database/50682657). It is for Firebase Realtime database but the same principle applies. – Alex Mamo Jun 13 '18 at 18:23
  • Depending on the number of customers (and frequency of update of the customer list), you could have an initial download of all the customers that you would store locally (e.g. in SQLite). Then you would implement the autocomplete text view proposed by Pragnesh with a good UI reactivity (instead of querying Firestore each time you enter a letter in the search field, which may lead to a not so good reactivity). And from time to time (e.g. when you open the app) you call Firestore to synchronise the SQLite with Firestore data. – Renaud Tarnec Jun 13 '18 at 18:48

0 Answers0