I get this string from Facebook:
{"data":[{"name":"Michaeli Legvine","id":"5157722412","picture":{"data":{"url":"http:\/\/profile.ak.fbcdn.net\/hprofile-ak-prn1\/48898_5175722412_6200_q.jpg","is_silhouette":false}}},{"name":"Walter Geere","id":"5169422865","picture":{"data":{"url":"http:\/\/profile.ak.fbcdn.net\/hprofile-ak-ash3\/41377_5149422865_9923_q.jpg","is_silhouette":false}}},{"name":"Dmitry Koltunovsky","id":"5470429061","picture":{"data":{"url":"http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v2\/yo\/r\/UlIqumHJn-SK.gif","is_silhouette":true}}},
In application I am running following code:
public void run() {
I'm not sure what's going on here, I apologize that I haven't had time to test anything out, but I've recently run into a serialization/deserialization issue with Flexjson and know that help is definitely needed! It seems to me like you'll need to use a
transformer
in your serialization and the
use()
method upon deserialization.
Again, sorry that's vague but a pointer helps more than nothing!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get this string from Facebook:
{"data":[{"name":"Michaeli Legvine","id":"5157722412","picture":{"data":{"url":"http:\/\/profile.ak.fbcdn.net\/hprofile-ak-prn1\/48898_5175722412_6200_q.jpg","is_silhouette":false}}},{"name":"Walter Geere","id":"5169422865","picture":{"data":{"url":"http:\/\/profile.ak.fbcdn.net\/hprofile-ak-ash3\/41377_5149422865_9923_q.jpg","is_silhouette":false}}},{"name":"Dmitry Koltunovsky","id":"5470429061","picture":{"data":{"url":"http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v2\/yo\/r\/UlIqumHJn-SK.gif","is_silhouette":true}}},
In application I am running following code:
public void run() {
try
{
Bundle bundle = new Bundle();
bundle.putString("fields","name, id, picture");
String graphpath = "me/friends";
//String token = _facebook.getAccessToken();
String response = _facebook.request(graphpath, bundle);
try
{
JSONDeserializer<FacebookFriendDto> deserializer = new JSONDeserializer<FacebookFriendDto>();
_facebookFriends = deserializer.deserialize(response, FacebookFriendDto.class);
if(_facebookFriends != null)
{
Log.e(TAG, "getFacebookFriends: " + _facebookFriends.toString());
}
}
catch(Exception e)
{
e.printStackTrace();
}
if (_facebookFriends == null || response.equals("") ||
response.equals("false"))
{
Log.v("Error", "Blank response");
}
I have all classes:
FacebookFriendDto.class
public class FacebookFriendDto {
public ArrayList<FacebookFriendsData> data;
}
FacebookFriendsData
package maler.zlitter.dto;
import java.util.ArrayList;
public class FacebookFriendsData {
public String id;
public String name;
public FacebookFriendsPictureData picture;
}
FacebookFriendsPictureData
public class FacebookFriendsPictureData {
FacebookFriendsPicture data;
}
FacebookFriendsPicture
public class FacebookFriendsPicture {
public String url;
public boolean is_silhouette;
}
And it deserilized it into id, name, picture array. But when I check PictureData object data – it is null.
Any ideas why it doesn’t work properly.
I'm not sure what's going on here, I apologize that I haven't had time to test anything out, but I've recently run into a serialization/deserialization issue with Flexjson and know that help is definitely needed! It seems to me like you'll need to use a
in your serialization and the
method upon deserialization.
Again, sorry that's vague but a pointer helps more than nothing!
FacebookFriendsPictureData data field isn't public. Either make it public or add getter/setter to it.