HI everyone.
I want to make a login app.
And it can store value , but when I register the same account.
It will success registered,not fail registered
You have to check storevalue2 procedure, is that right?
yes .
when user enter is not empty.and i call the tinydb to get value and check account or password are they the same.
if same it will show message ,else will store value in tinydb.
You might use this tutorial as an example https://eixerits.wordpress.com/2013/02/03/a-login-template/ if you can not correct your own account log in code or use parts of it to make your code do what you want it to.
Thank you for you advice,but my school claim we must use tinydb.
cann't use tinywebdb.
but I will reference your advice.
OK. Do what you have to. You do not need to use the TinyWebDB. Simply substitute the similar TinyWebDB example part of the tutorial to use a TinyDB. The two databases are similar, one uses the Web, the other is internal to your Android.
This might help you substitute
thank you.
But after I read those web. I still don't know how to let app can judge account or password is it repeat.
Here is one simple way to check if an item is in a List. Be aware, this method is case sensitive (tom is not the same as Tom)
Notice that Tom is in the database but tom is not so the method does not catch the 'duplicate'.
Use this simple check as long as case is not an issue. If case is an issue, you have to iterate through a List and check for both tom and Tom
or insist in your input TextBox that names be always input into the database as upper or lower case characters (upcase or downcase). Not certain how this would work with Chinese glyphs.I find it is more convenient to work with Lists rather than directly check against the contents of the database.
Sorry,I'm deal with anothoer problem at this time,so I don't have fix this problem.
but, now it show the wrong message,and I don't know how to fix it.
Sorry, I do not know either. The problem is related to your check for is in list? shown in the error message in one of these Blocks
Use the DoIt debugger and you probably can find out.
Earlier, I indicated
My opinion is you made this difficult by working directly with the content of the TinyDB but it is the path you have taken and you can probably fix the issue.