Java show OAuth webpage - java

I am developing a Java desktop application and need to access the LinkedIn API. In order to do this, the user has to login on the webpage that LinkedIn sends me back. But how can I easily integrate that in my application?
JEditorPane is not meant to show html pages and it really does not look good at all, so that is not an option.
Thanks in advance!

Have You seen Scribe? It has LinkedIn support out of the box, looks like you may be able to use it...
https://github.com/fernandezpablo85/scribe-java/blob/master/src/test/java/org/scribe/examples/LinkedInExample.java

Related

Website to android app approach

I'm a newbie android developer and we have a website that sells some stuff (using a payment gateway), you can also login on the site using credentials, facebook, or google+ login. Now we have a need for an android and iOS app. What is the best approach to port the site functionalities to Android or iOS app? What are the issues I need to consider when I choose one approach? What would be the best approach: native, hybrid (phonegap, xamarine etc.) or using wrapped (using webview as far as I know)? I'm especially interested in the user login part (because I want the user to be able to login to his account if it exists and if not to create it using the website API endpoint - this is how I imagine it), how to solve that when choosing between these approaches? Any suggestions (answers, comments, links, books) would be helpful.
Thanks
My sugestion is to do native, always can reach more performance in multi thread ,high concurrency transactions and heavy applications.
For android, you can build from source an application, and export the html/css content to the smartphone using android.webkit.WebView. Take a look:
https://developer.android.com/reference/android/webkit/WebView.html
I think is a excellent solution for your problem.

Is it possible to add a facebook like button on a Java application?

I don't want a pop up, I want an actual Facebook like button, has anyone got any idea how I would go about it? Is it against Facebook policy?
Thank you
I don't think this is anything specific to Java. Just use whatever method of generating HTML you are using, and put the tags in to load the Facebook javascript SDK and put an fb:like element on the page.
Currently there is no API by which you can create a Like directly - the only way a user may "Like" something on Facebook is using their Like button code embedded in the standard way.
You can create your own actions on the timeline that look like a "like", you just need their permission. You can use OAuth to get that, google can help you find examples of Facebook clients in Java.

Is there a way to display web component in the j2me program? I am programming for a s40 series Nokia phone

I am trying to display a small web content in my application. Is there any way to display a web content?
Currently I am displaying a link, and upon clicking that link my application will close and web browser will open to display the web page?
I want to display the web content inside my application without closing my application.
Any help will be highly appreciated.
Thanks,
HTMLComponent doesnot work upto mark and sometimes control swtching does'nt happen exactly according to flow but still we can use it as we dont have alternative solution in J2ME
LWUIT has a HTMLcomponent that you can use. It has limitations but can work

How to like a page on fanpage on facebook without a mouse

BACKGROUND
I'm doing an interactive art project for school.
PROCESS
For this project the last step is to go to a facebook fanpage and like the facebook page.
ASSUMPTIONS
I'll be using Java to open up a browser and then go to the facebook page. However, I would like to use something like one line of script to like the facebook fanpage.
PROBLEM
Is there will be no mouse for this interaction.
SOLUTIONS
Is there a script I (or stackoverflow) can write that I may execute that will like a facebook page?
Or is there any other solution that you guys can think of?
TOOLS/LANG. BEING USED: ARDUINO/JAVA, HTML, JAVASCRIPT and CSS.
You could use a browser automation framework like Selenium to load the Facebook page and simulate clicking on the Like button, but you would have to log the correct user in first. Selenium has a Java interface you could use.
Alternatively, if you are having it run on a single machine you control, you might have luck with doing some sort of userscript (something like this one) for the Facebook site so that when they are on the correct page, it clicks the Like button automatically. Then all you would have to do is launch the page from Java in the correct browser, and the userscript would do the rest. Note: Userscripts work on Firefox with GreaseMonkey installed, and on Chrome/Chromium without any extensions.
Make an application on Facebook and use their api to interact with the page: Facebook API
Alternatively, use some javascript to like the page once you navigate to it

Facebook login using java-facebook-api

I am struggling from couple of days, to add facebook login to web app using java facebook api, since my web application is java/j2ee application. I went through few blogs, since facebook doesnt have provide the official java library.
I went through this blog and code and tried to make a prototype, but its not working, i could say i spent lot of time debugging the code and removing the errors which I got instead of testing the code.
Logging in with Facebook Java API
Facebook Java api example to publish on Wall
I also took a look at the facebook javascript login button which is quite simple and easy go, but I have couple of clarifications to be made her.
When the user logins I want to retrieve his email_id,profile_picture and also his name, rest of the things I will ask user to fill it up.
My questions are here
How do I retrieve the profile_picture of the user?
A user should be able to see the name and picture of the users who all are logged in
use facebook login,so should be save the picture in the database or I can get it dynamically?
How do I manage the database, suppose the user A visits my site and clicks on fb login for the first and the same user A visits my site for the site and clicks the fb login button, how should I managing the user sessions?
Kindly help me
thanks in advance
Well, I think the best you can try to do, and I offer my help to do it, is "convert" the php sdk classes (base-facebook.php and facebook.php) into java classes. After that it will be easy to answer your questions. By the way, if you gonna do some server-side processing, why not using php instead of java-ee?

Categories