Registered user check for lowercase or uppercase - android

I want to know how to check the existing users for either upper or lowercase when a new user is signing up. At present for example the followig two users can be registered
tom and Tom, both of these are considered as two separate users, so if this happens I want to sound off to the user that the username already exists. Where in code exactly can I do this?

You can create a textwatcher for the edittext where user enters loginname and when focus changes from the edittext get the string in there using getText and pass this to an api which will check the username with db to check for similarity and will return a status false if similar user exits and you can show a red underline or red hidden badge to side of the edittext on the basis of this result to notify the user that such a username already exists.

Related

How to create mention edit text like facebook

I want to create a edit text where user suggestions will be shown when user typed "#" keyword.
For eg. If the selected user is: "James test user".
And if user press delete character(back space in android keyboard.) then it should delete the word by word instead of characters. just like first user will be deleted then test and then james.
Any lead will be great for me.
I've tried the https://github.com/linkedin/Spyglass and https://github.com/hendraanggrian/socialview. But they won't fulfill my requirements.

How to identify a Login Page of a App from my app using Accessibility in android

Hi. Using Accessibility, i am trying to auto fill username &
password of an any app from my app which is managing username &
password of all apps like dashlane. i found one way to auto fill
field value using Action_Paste. when user starts to focusing on
EditText it will get the AccessibilityNodeInfo by using getSource() method, using that it auto
fills EditText Filed, below is a code for above process.
Code:
AccessibilityNodeInfo source = event.getSource();
if (source != null) {
ClipboardManager clipboard = (ClipboardManager) MyAccessibilityService.this.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("label", "TEST DATA");
clipboard.setPrimaryClip(clip);
source.performAction(AccessibilityNodeInfo.ACTION_PASTE);
Toast.makeText(MyAccessibilityService.this, "Pasted Successfully", Toast.LENGTH_LONG).show(0;
}
Here i need to extend my ui like, it needs identify the login page, once its confirmed as a login page it will show the list of login item. based on user selection it will auto fill username field & password field.
Here i have two question
how to identify the login page of an app, i tried something like, when user clicks a First Edittext filed i will search for next node and check whether it is password filed or not? i used getchild() method. but does not give the child element. When login page loaded in app, i need identify whether it is login field or not? How can i identify a login page, please any tutorial welcome.
based on the source i am filling the field values. if i identified a login page then how to get AccessibilityNodeInfo of username & password. So that i can fill both fields rite?
i spent time for those problem.but i cant get any thing. please anyone can give deep explanation & tutorials for the above problems. thanks.
Use getRootInActiveWindow() to get the root node & iterate the tree to check all the nodes.
My answer here might help.
This way, you will find your Username & Password nodes.
Now, you can paste the text in these nodes.
But i will suggest to not use clipboard to fill passwords as there are some apps that continuously watch your clipboard.
Such apps can intercept your login credentials.

Android edittext : show swim out prompt with last logged in email

I have email edittext field and need to show last successful logged in values of email, if first characters of them are equal.
I know, that successful logged in values I can store in the sharedPreferences. But how can I show it and when user clicks on it, it have to be setted in the login EditText.
How can I do it?
Use an auto complete EditText as login field like in this page http://android.foxykeep.com/dev/how-to-add-autocompletion-to-an-edittext

How do I make a toast display for this specific edit text field

Hi I am kind of stuck here, I have an activity which lets the user create a transaction from his bank account, the activity has some text fields.One of the text field is for balance entry. When the user enters the balance he wants to withdraw there should be an internal checking of the balance present already in the user's account. I know how to create the internal checking, the problem is that when the user enters an amount in that particular text field there should be a toast displayed letting the user know that he has entered an invalid balance withdraw request,or something like that. How can I do this? Are there any listeners for accessing that particular text field?Thanks.
Instead of showing a toast message, you should use TextView.seterror . This can be done where you are doing checking.
I would use a TextWatcher
Just add the Textwatcher as a listener on your editable:
editable.addTextChangedListener(new TextWatcher() {
//Override Methods
});
In the method afterTextChanged(Editable s) you can start your validation. If validation fails you can inform the user with a Toast or an error text(setError) on the Editable
If you want to display a validation error on a specific EditText you should use:
{EditText}.setError(CharSequence error)
OR
{EditText}.setError(CharSequence error, Drawable icon)
That should bring up the toast you want.
Regarding the logic of validation, it's up to you of course...

I have an app where I am asking for input a username and password.Right now. It has been changed. Once the user clicks on login in the login menu

I have an app where I am asking for input a username and password.
Right now. It has been changed. Once the user clicks on login in the login menu.
The username should be refilled with a known username and we only ask the user to input password to improve user experience.
Could we use the exist username edit text in my layout file or i have to change to label instead of edit text? I know i can use setText() to populate the username edit text field.
The question is not about saving username (using sharedpreference). what is the best way to
change my code to use ( either edit box or label ).
Please let me know what is the best case to avoid too much change.
Use SharedPreferences to store the usreanme and then everytime you load the layout in your code, check your sharedPreferences and fill the username edittext using setText

Categories

Resources