My Code is:-
try
{
params.putString("fields", "first_name");
params.putString("fields", "last_name");
params.putString("fields", "link");
params.putString("fields", "gender");
params.putString("fields", "birthday");
JSONObject json = new JSONObject(facebook.request(Id, params));
JSONArray array = json.getJSONArray("data");
if(array != null)
{
for(int i=0;i<array.length();i++)
{
String name = array.getJSONObject(i).getString("name");
String birthday = array.getJSONObject(i).getString("friends_birthday");
String location = array.getJSONObject(i).getString("friends_location");
String web = array.getJSONObject(i).getString("friends_website");
System.out.println(name+"-"+birthday+"-"+location+"-"+web);
}
}
}
catch(Exception e)
{
}
where do I am commtting mistake. please help me. Thanks in Advance
it is very hard to help you without you telling us what you are trying to do with your code and what is going wrong with it.
However, by looking at your code, I would tell you to confirm that you are putting the fields you want in the correct way. If params works like an hashtable, you would be overritting the values for key “fields” – so instead of asking for first_name, last_name, etc you would be asking only for birthday.