Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3600396
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:29:23+00:00 2026-05-18T20:29:23+00:00

I am building an Android app in which user are required to choose a

  • 0

I am building an Android app in which user are required to choose a nick name. Now, two users cannot have same nick name. I have seen forms on .net where we can verify the availability of a particular username while user types or presses tab using Ajax calls.

My questions is – is anything like that available for Android. Can I query my server on the fly and verify the availability of a nick name.

Thanks a lot for your responses. If there are any tutorials, samples or Android doc references I need to look at please guide me to that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:29:24+00:00Added an answer on May 18, 2026 at 8:29 pm

    you could query your server’s database of users with the currently entered username on every keypress event for the specified input component(EditText, etc), but that might be pretty network intensive and spawn a lot of threads to handle:

    1. add a TextWatcher to your input EditText or whatever the user is entering his name into
    2. in the onTextChanged method, you would spawn a thread to contact your database sending along the CharSequence value. the response from your server would output some JSON perhaps with a boolean property which says if the username is available or not
    3. user hits “ok” and expects their name to be registered for themself. a final check needs to be made before they actually get this nickname, as the availability may have changed since(say a ton of people are registering all at once)

    or…

    1. let the user type in their desired name
    2. let them hit “save” or “register”
    3. at this point, send along the registration data and save it in the database if their name is available. otherwise, let the user know that it isn’t and they must try again

    or…

    when you app starts(right before they must pick a name), contact your server’s database and send the app a response holding a list of names that are already taken.

    this way, you can easily check if the name is taken locally on the phone rather then sending off a request to check.

    you must still always check the availability of the nickname right before saving it on the server side

    edit:
    I’ve implemented #2, which seems like that’s what the majority of apps do for registering a unique name(that ive seen)

    problem with #1
    – user enters in 1 letter(network thread started)
    – user enteres another letter(another thread started)
    – user enters a 3rd letter(another thread)
    – thread 2 finishes first, name is valid, user is notified
    – thread 1 finishes, name is invalid, user is notified
    – thread 3 finishes, name is invalid, user is notified

    thread 2 took 4 seconds
    thread 1 took 5 seconds
    thread 3 took 5 seconds

    say user keeps typing for 25 letters, there is a lot you have to keep track of in terms if the name is valid or not, if and what threads are still running, etc

    this approach seems a bit too tedious for such a simple registration task, too much hassle

    problem with #3
    – requires 1 extra network request to the server

    i like this approach because you can easily and quickly notify the user if their name is available without any threading(depending how large your user list is) or worrying about how long it will take to check

    number 2 is simple, easy, and can have the chance to only require 1 server request

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.