2

In my android application, user can logging in using facebook/twitter.

https://graph.facebook.com/username/picture 

https://api.twitter.com/1/users/profile_image?screen_name=screenname&size=normal

using above url i know, i can get picture but is there any way i can download and store it in my database?

i need list of user's profile picture who logged in using facebook/twitter and i have to get it from my server database. (i have to display like below image)

enter image description here

Viswa
  • 3,211
  • 5
  • 34
  • 65

1 Answers1

2

Use an AsyncTask to download it and save it to your app's disk space. In your database, just store the file path of the picture (I would save it with the filename being the FB user id).

You can see how to use an AsyncTask to do a web connection in my code at github. https://github.com/nedwidek/Android-Rest-API

I'd need to switch workspaces to get to code that works with the local storage.

Erik Nedwidek
  • 6,134
  • 1
  • 25
  • 25
  • I understood what is AsyncTask, but i am using sencha touch for creating view. can i use AsyncTask ? – Viswa Jan 21 '13 at 08:49
  • I haven't used on any Sencha projects. On PhoneGap, I would use a plugin to extend the functionality of the framework. Not sure if you can do that with Sencha. – Erik Nedwidek Jan 21 '13 at 21:37
  • Can you see my post? I am unable to do it https://stackoverflow.com/questions/45972188/unable-to-save-facebook-profile-image-with-asynctask – tccpg288 Aug 31 '17 at 02:33