Android - How to load thumbnails of facebook photos? - android

I'd like to ask if there is any way to request only small-sized thumbnails of photos from facebook albums. My vision is to create an icon for every user's album that will consist from 3 overlapping photos, something like this..
..and I don't wanna wait until all large images are downloaded. Of course downloading will not run in UI thread, but still.

It is described here: https://developers.facebook.com/docs/graph-api/reference/v2.1/album/picture
There are examples for several platforms/langs

Related

How to upload multiple files to Firebase from Android?

I have a simple phototaking android app that allows the user to take a photo and save it. I allow the user to create multiple versions of the photo in the app - adding captions, filters, etc. After the user is finished, I upload the photo to Firebase storage. Here I upload a few files
The original raw bitmap that was taken using the camera
The finished bitmap with all edited captions and filters applied
The thumbnail of the the raw bitmap, and finally
The thumbnail of the finished image
The thumbnails and the full size images allow users to undertake future interactions with the app.
What would be the most efficient way to upload the images? Options that I know of are
Using 4 different upload tasks from the Android app. But this is taking a few seconds to finish all 4 uploads.
Using 2 upload tasks for the fullsize images and then using Firebase 'functions' to create the the thumbnails in the server. However, I would need to create the thumbnails locally in the app for display purposes before uploading, so it would mean creating the thumbnail in 2 places - app and the server. Also it would mean doing double error handling - one at the server side and the other on the app end.
Is there any other option?
Looking forward to whatever help I can get. As usual, feel free to ask for clarifications, via comments.
That depends on your scenario. If you are on "Spark" plan then using firebase functions too much might exceed your free quota of:
Invocation (125K/month)
GB-seconds (40K/month)
CPU-seconds (40K/month)
But if you can upgrade to "Flame" or "Blaze" then it won't be an issue and its the preferable way.
On the other hand, thumbnail file aren't too big that takes much time for uploading, unless you are on extremely slow connection, then uploading thumb files from app won't be an issue. You might not even notice the uploading time. It will be quick.

Are we allowed to make our own image uploaded in different website in our app for download?

We have our own Artwork and photography images uploaded in different websites like Tumblr,500px,Deviantart,Flickr etc.So for every image there will be already some URL which is publicly available for everybody to view or download.
Example of such a URL is : http://40.media.tumblr.com/b12772f7533b6283ca008ba8d7ec2192/tumblr_nsezua4hur1r4xqayo1_500.jpg
Like there will be a lot of URL, and we are able to show this in our app and app let user to download this URL. Since the server is not our own, But the images are our own, are we allowed to use these urls in our app to show as a gallery app and let the user download it to their own.
Is it allowed? This is related to programming, because we have seen same websites providing their own APIs to fetch data. But we dont want too many details, Our requirement is simple, So we are trying to keep it simple and economical.
You should be fine, but check that the URLs don't change, or you'll be left with a lovely little error.

Mobile Application Development using Android

I am developing an android application in which when a user logins through facebook his profile picture gets stored. Then the user is shown the profile pictures of his fb friends who have installed the app, one by one. First, one friend's pic is shown then on click of next button, next friend's pic is shown. This continues till all the friends images have been shown to the user or user has skipped the section.
First, I thought of storing all the images in my database and then retrieve them one by one as the user presses the next button. But doing so will render very slow performance as for every time an image has to be shown to the user I have to hit the db.
The alternative is to store images in my local drive and store every image's location in the db.
Please elaborate on how this could be achieved and the performance issues in this case considering a large user base?
Also suggest any other way of achieving the aim, if you may.
I am using WAMP for the purpose.
Thanks in advance.
The pictures are stored in the apps cache after they are downloaded.
When the user logs in to fb for the 1st time it will download the images.
2nd time it will get them from cache unless its a new image.
clear the cache when it gets to a certain MB limit and keep it small
I suggest using Google Volley library to get images from the net as when setup properly you can expire / clear images from the cache.
The are are other libraries for image loading and handling to consider such as Universal Image loader and Picasso but Volley can also be used for fetching Data from the Net.

Images, Caching and Sprites in Android

I've got a really simple (so far) Android app, which basically shows your friends on a Google Map. Think Latitude.
The friends are represented as avatar pins, the images of which are downloaded from the internet.
When a "friend" is added, i fetch the avatar in a background thread. I then don't need to download the avatar again (i'll probably check for updates during app start, but not too fussed about that right now). The actual images will most likely come from a social network (Facebook, Google, Twitter, Gravatar, etc)
Now, the map view will basically always be displayed, so the images are essentially always present. I will however be performing image manupilation, stacking, etc for these avatars.
Given the above information, here are my questions:
Where should i cache these images? Looking at the docs, i feel like a Disk Cache would be the best option?
Should i think about creating an image sprite? Remember, these images don't live in the APK/resources, they are dynamically fetched. Perhaps i could create a per-friend sprite with all the different image sizes i will require?
I also have access to the server which returns these images (right now they just return a URL) - so should i enable this server to instead do image processing/resizing etc based on my requirements, or simply download the original image and then perform the processing on my client application?
You can use lazy loading to dynamically download the users images from the URl and store it in cache. I believe this link would help you out in this :
https://github.com/thest1/LazyList

android getting all user's friend profile pictures quickly

I'm looking for a quick way of getting all my friends's profile pictures.
I'm using the Facebook SDK for Android.
right now I'm getting my friend's list JSON object and running with a for loop inside this object.
in the loop i'm putting each image in a Drawable object from the: http://graph.facebook.com/uid/picture.
I've seen that each picture weight only 4K and it goes fast for few friends.
but what if I have 1000 friends and i'm connecting to facebook for each one of them?
it will take lots of time.
I've seen in other application that some of them show all your friend real quick.
what is the best way of doing it? using the runner?
If each picture is 4K and you have 1000 friends, that's approximately 4MB of data. It'll take time to download it. There's no way around it if you need all of their pictures.
That said, you should think about whether you really need all of their pictures or not. The vast majority of apps will use the profile pictures of friends to display to the user. Reasonably speaking, the interface is not going to display 1000 friends all at once. A good solution in this case might be to lazy load the images, i.e. store the URL of the image when you parse the JSON for each friend, but don't download the actual images until you need them. If say your interface shows 10 friends at once, then that's only 40K of images which is a whole lot more reasonable.
You can search StackOverflow for android lazy load list images but here's one particular thread that may come useful: Lazy load of images in ListView.

Categories

Resources