Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Android - Ajax style auto check of username availability -


i building android app in user required choose nick name. now, 2 users cannot have same nick name. have seen forms on .net can verify availability of particular username while user types or presses tab using ajax calls.

my questions - available android. can query server on fly , verify availability of nick name.

thanks lot responses. if there tutorials, samples or android doc references need @ please guide me that.

you could query server's database of users entered username on every keypress event specified input component(edittext, etc), might pretty network intensive , spawn lot of threads handle:

  1. add textwatcher input edittext or whatever user entering name into
  2. in ontextchanged method, spawn thread contact database sending along charsequence value. response server output json perhaps boolean property says if username available or not
  3. user hits "ok" , expects name registered themself. final check needs made before nickname, availability may have changed since(say ton of people registering @ once)

or...

  1. let user type in desired name
  2. let them hit "save" or "register"
  3. at point, send along registration data , save in database if name available. otherwise, let user know isn't , must try again

or...

when app starts(right before must pick name), contact server's database , send app response holding list of names taken.

this way, can check if name taken locally on phone rather sending off request check.

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

edit: i've implemented #2, seems that's majority of apps registering unique name(that ive seen)

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

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

say user keeps typing 25 letters, there lot have keep track of in terms if name valid or not, if , threads still running, etc

this approach seems bit tedious such simple registration task, hassle

problem #3 - requires 1 network request server

i approach because can , notify user if name available without threading(depending how large user list is) or worrying how long take check

number 2 simple, easy, , can have chance require 1 server request


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -