Belhor
02-15-2011, 03:02 PM
Hello,
i'm interested in becomming android developer,so for a week now watching tutorials,reading them etc etc...
Figured i could try to make my first program a Contacts Manager.
So first what i want to do is to retrieve info from Contacts on my phone,ok,so reading some tutorials i already understood that that's done via Content Provider.
No biggy,ok...but ofcourse there's no way i can know how to do that and haven't got a clue how to figure that out with logic thinking,except ofcourse by reading tutorial on that,so ok,no biggie again,found one through Google( http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/1/ )
Granting access,nothing serious,that's how it's done and now i need to remember that.
First part of the code isn't hard to understand,read a little bit on developer.android asswell,so nothing too serious,just need to remember everything again,but later stuff just got my head dizzy...
For example smth like:
if (Integer.parseInt(cur.getString(
cur.getColumnIndex(ContactsContract.Contacts.HAS_P HONE_NUMBER))) > 0) {
Cursor pCur = cr.query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI ,
null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",
new String[]{id}, null);
while (pCur.moveToNext()) {
// Do something with phones
}
pCur.close();
}
1. ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",
new String[]{id}, null);
it reads contacts id and..have no clue next stuff what is.
2.I figured that i saw somewhere ContactsContract.CommonDataKinds and i was right,it's on developer.android( http://developer.android.com/reference/android/provider/ContactsContract.html ).
But how could i figured out that Phone numbers ar specifically in this class,i just should've clicked on all of them listed until i find Phones?
And all in all is it really the only way for each step you would want to make to just look online on some tutorial and then remember how to do it(how it writes),there's no logic way to guide yourself towards that,because that's sound nuts to me?What i don't understand here?
So can anyone explain to me why am i blind in here and how to turn the lights on?
If you need to clarify what i'm asking,just ask and i'll try to explain it somehow otherwise.
Thanks all.
i'm interested in becomming android developer,so for a week now watching tutorials,reading them etc etc...
Figured i could try to make my first program a Contacts Manager.
So first what i want to do is to retrieve info from Contacts on my phone,ok,so reading some tutorials i already understood that that's done via Content Provider.
No biggy,ok...but ofcourse there's no way i can know how to do that and haven't got a clue how to figure that out with logic thinking,except ofcourse by reading tutorial on that,so ok,no biggie again,found one through Google( http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/1/ )
Granting access,nothing serious,that's how it's done and now i need to remember that.
First part of the code isn't hard to understand,read a little bit on developer.android asswell,so nothing too serious,just need to remember everything again,but later stuff just got my head dizzy...
For example smth like:
if (Integer.parseInt(cur.getString(
cur.getColumnIndex(ContactsContract.Contacts.HAS_P HONE_NUMBER))) > 0) {
Cursor pCur = cr.query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI ,
null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",
new String[]{id}, null);
while (pCur.moveToNext()) {
// Do something with phones
}
pCur.close();
}
1. ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",
new String[]{id}, null);
it reads contacts id and..have no clue next stuff what is.
2.I figured that i saw somewhere ContactsContract.CommonDataKinds and i was right,it's on developer.android( http://developer.android.com/reference/android/provider/ContactsContract.html ).
But how could i figured out that Phone numbers ar specifically in this class,i just should've clicked on all of them listed until i find Phones?
And all in all is it really the only way for each step you would want to make to just look online on some tutorial and then remember how to do it(how it writes),there's no logic way to guide yourself towards that,because that's sound nuts to me?What i don't understand here?
So can anyone explain to me why am i blind in here and how to turn the lights on?
If you need to clarify what i'm asking,just ask and i'll try to explain it somehow otherwise.
Thanks all.