I have tried almost everything mentioned anywhere but still i am unable to get the profile pic of the logged in user in my android app. Following is the code which I am using :-
new AsyncTask<String, Void, Bitmap>() {
@Override
protected Bitmap doInBackground(String... params) {
try {
URL url = new URL(params[0]);
return BitmapFactory.decodeStream(url.openConnection().getInputStream());
} catch (Exception e) {
Log.d("ERROR", "Unable to get Image");
}
return null;
}
@Override
protected void onPostExecute(Bitmap bitmap) {
if(saveFlag) {
saveImage(bitmap);
}
imageView.setImageBitmap(bitmap);
}
}.execute(url);
Url for the image is :- http://graph.facebook.com/{ID}/picture. I am able to see the image when I go the url from browser. I have tried both http and https.
Someone help.
Edit: I dont want to use any other api other than fb or normal android's.