code to get phone nos from contacts in android -


I am creating an app that has <3> contact with contacts, , me A ready code should be done to do this and the user should be shown in a layout which he has chosen. I've heard that this work is being done in a background thread , I was thinking that if I put it in the

  extension asyntask   

Is this true ?? Please give me full code to do this.

My Activity In which I have to include this code, it is like this:

  Public category registration activity is removed. OnClickListener {registered user user; Edit Text Name, Mobile; Button Guardian 1, Guardian 2; Submit the button to the override protected creation of zero (InstanceStatus saved from bundle) {button; Super.onCreate (savedInstanceState); SetContentView (R.layout.registration); Submit = (button) Find VVBIID (RID.Registry_Rugeration_Submit); Submit.setOnClickListener (this); } @ Override Public Wide Onclic (Switch) (Switch (Getit.GetID)) {Case R.Did Register: "); New SendRegistrationData (getBaseContext (), Registration.) Execute (user);} and Toast. GetBaseContext, "You are not connected to the internet. Please connect yourself and try again. ", Toast.LnnHLLG) Show (Default) Log D. (" app "," no button match ");}} Private boolean input data () {User = new registered user (); name = (edit text) Search ViewById (R.id.registration_name); mobile = (edit text) Find VVBIID (RID registration_mob); user.setName (name.getText () toString ( ) Trim () ..); user.setMobile (mobile.getText () toString () trim () ..); // Input no I also want code to get 3 contacts here and code and verification on mobile http: // ** Click the button on the user button. Button.setOnClickListener (New OnClickListener () {@Override Click Public Zero ( See ARG0) {New GetContact (.);}}}); / * / Has also registered a validity to check whether the user has chosen the three contacts, not the input data incorrect Return, so that the form can not be submitted * Returns * True;} is the Public Boolean Connect () {Connectivity Manager connMgr = (Connectivity Manager) getSystemService (Activity. CONNECTIVITY_SERVICE); NetworkInfo NetworkInfo = connMgr.getActiveNetworkInfo (); If (networkInfo! = Null & amp; networkInfo.isConnected ()) return true; Second false return; }   

}

to basically retrieve What you need to do is use the Contact Content Provider with your phone:

You have to ask your contacts and say how you would like to recover those fields, this query will give you the cursor And this cursor can be used

On this page you get a full document about it Can and are:

Once you take hold of it, it is very easy.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -