aspose file tools*
The moose likes Applets and the fly likes Facebook friends in an applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Facebook friends in an applet" Watch "Facebook friends in an applet" New topic
Author

Facebook friends in an applet

Jamie Morrison
Greenhorn

Joined: Apr 01, 2010
Posts: 4
Hi,
I have made an applet that does some processing with a list of source images and displays the results. It works fine for the list of 20 images that I have inside my applet jar, but I would like to get these images from the internet.
Specifically from Facebook. I would like that the user comes to my applet and enters their name and password into my applet and then they will see a thumbnail list of all their facebook freinds.
Now, I know how to display an image in my applet given its URL and I know how to do the processing that I want to do but I dont know how to do the Facebook stuff.

So I suppose the method I would like to implement inside my applet would be something like this:



Do people think this is possible and can anyone point me in the right direction of where to start researching how to do this.

Thanks a lot,

patumaire
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
Is this an April Fool's Day joke? Nobody in their right mind is going to enter their Facebook credentials into an unknown applet.


Ping & DNS - my free Android networking tools app
Jamie Morrison
Greenhorn

Joined: Apr 01, 2010
Posts: 4
Hi,
It is not a joke.
Look at this example of an online app that allows the user to use photos from their Facebook account:
http://sendables.jibjab.com/personalize/251/disco?category_id=9
If you click on 'Get Started', you have the option of importing some photos from your Facebook account.
So, this sort of thing can be done, but maybe not in an applet. If not, does anyone have a suggestion as to how it can be done or how it is done in that link?
I would like to use an applet because my application logic is in Java, but maybe my list of URLs can be fed into the applet from some external code that has got them.

Any ideas,
Thanks a lot
Jim
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
Of course it *can* be done, the question is: is it a practical idea? Would you trust your FB credentials to some applet out there on the web, and then have to rely on that it isn't up to no good? I sure wouldn't.

If the applet should access FB directly, then it would need to be signed (otherwise it wouldn't be allowed to access the site). The alternative would be to have the applet call a proxy on your server that does the interaction with FB, and which then returns the images to the applet over HTTP.
Jamie Morrison
Greenhorn

Joined: Apr 01, 2010
Posts: 4
Thanks a lot for your reply Ulf.

>> The alternative would be to have the applet call a proxy on your server that does the interaction with FB, and which then returns the images to the applet over HTTP.

This sounds decent to me but I have very little experience with this sort of thing. I dont know what you mean by proxy in this sense. Can you tell what sort of technology you are talking about here and I will investigate it further in tutorials, other forums etc.

Thanks a lot,
Jim
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
The proxy would be some server-side code (like a servlet) that acts as FB proxy for the applet. In other words, the applet would access your server, which in turn accesses FB, and then returns whatever data FB sent back to the applet.

This is even scarier as as security scenario, because now not the user's computer accesses FB on their behalf, but some completely invisible piece of code (on your server) over which the user has no control.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Facebook has a developer's program through which you get an API to talk directly to facebook and get all the information you could possibly want. I looked into it once but I forget many of the details. I know that it's a server-side API, and I'm pretty sure they give you black-box libraries to work with (and they're not Java.)

But in any case, if you're serious about this, then you can join the fb developer's program, do all your fb interaction on the server, and then your applet can just be a relatively thin GUI over that.


[Jess in Action][AskingGoodQuestions]
Jamie Morrison
Greenhorn

Joined: Apr 01, 2010
Posts: 4
Thanks Ulf and Ernest,
That's exactly what I was after, just a start so I know where to look.
Thanks again
patumaire
 
Consider Paul's rocket mass heater.
 
subject: Facebook friends in an applet