is there a possibilty to avoid redundance in the firebase database?
I have an app where users can add a first, and a second word. With a button you can get a random word of this two words.
Random rand = new Random();
int n = rand.nextInt(9);
Random rand1 = new Random();
int m = rand1.nextInt(8);
String first = sp.getItemAtPosition(n).toString();
String second = sp2.getItemAtPosition(m).toString();
out.setText(first + second);
So I get the words from the Spinner (please don't ask why this way)
Ok so now. How can I check, if the random choosen word is already in the database or not?
With an if-else instruction?
The structure looks like this:
{"1stWord" : {
"1stWord" : {
"-LI125GLPy0-IPAm4GEM" : {
"name" : "test"
},
Thanks in advance guys!