Facebook API and Facebook Connect using Java? - java

New to Facebook API and Facebook Connect.
Found the Facebook Java API open source library on Google Code...
I am really excited that there's an API pre-written in Java for it!
Am interested in writing a server side Java layer which uses REST to be able to access a user’s Facebook Friends List, their wall, send them messages in-network, etc.
Downloaded the binary and unfortunately, I haven't found any sample or demo code when I unzipped it...
Question(s):
(1) Does this library support Facebook Connect?
(2) What is the best way to get start using Facebook Connect with server side Java?
(3) Since I am building middleware, do I still have to create a sample app on the online Facebook Developer page?
(4) What should I include in my (am a newbie in Maven) pom.xml in order to get started?

Use RestFB, that seems to be the inofficial FB Java Api:
http://restfb.com/
(There is no official FB Java Api anymore)

As far as I know, that library is broken. I couldn't get authentication to work with the latest version.
In my search for alternatives i found the "TinyFBTagLibrary" http://www.socialjava.com/ --
Yes, it requires just about a billion extra libraries to run, but it offers a simple way to execute facebook API calls in java that ISNT BROKEN (once again, as far as I know). My advice is to ignore all of the predefined tags for use in jsp and scroll down to the bottom to see how to use the TinyFBClient.call/getResponse when you need to get information.

Related

How to make an API to interact with my app

How can I make an online server to access API's and handle requests? Then how can I have my android app access this online server to make requests?
I have an android app that I am building for a school project. This app will need to use multiple APIs to gather information to display to the user. However I don't want to allow people to decompile to source code and take my API keys. My plan is to build an online application that will do all of this work on the server side. This way the user only submits a query and the server sends information in response to their request. This will speed things up for the user and keep the keys from being accessed by other individuals.
Steps I think I need to take.
Set up server to access the API's
Make app access online server through HTTP requests
3....
4...
I have a very general concept in my head, but I'm not sure where to begin. If I'm wrong on any part of this question please correct me.
I do plan on moving this to the app store in the future.
edit: Do you know of tutorials that show the building of the API and then loading it to Amazon AWS or another server?
There are many options when building restful services for api consumption. You could start with php, which is the easiest to start with. Here is a nice tutorial that takes you through the initial stage all the way to the end of building login system for android using mysql and php as the server language. It contains the barebone details of setting up the infrastructure and logic. I think from there you manipulate and go further.
https://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
check out java rest easy, it is a nice tool to use to build web API's. You can host it for cheap at red shift or amazon using their pay what you use billing.
The cheapest way for you to host your REST API is to use Amazon's API Gateway. You pay for what you use and pay nothing if it is not being used. API Gateway plays very nicely with Amazon's Lambda service that allows you to run discrete code units - again, you only pay for what you use. Lambda itself plays nicely with Amazon's pay-as-you go NoSQL datastores (SimpleDB and DynamoDB).

How to make a connection to a Google Drive folder using the Drive API

I've searched a lot through the web about this topic (even on StackOverflow), but the questions I was looking at weren't able to help me, so, here it is (Although im very good at it, english is not my native language, so I'm sorry for any mistake made): (SKIP TO EDIT)
I'm making a simple chat program in Java (self learning), and, at first, I wanted to access a file on my computer. I soon found it hard to acomplish, and decided I wanted to access a drive folder on MY account. So, I googled about a possible Google Drive API. And I found it!!!
I downloaded a copy of the API to my PC, and then i went online to know how to use the API, but the README.txt file and the youtube tutorial were not helpful at all, because i could not understand the instructions. I Looked everywhere but still didnt find an easy-to-understand answer.>
So, im asking if any of you could provide a step-by-step tutorial on how i can accomplish my goal. Ive created projects on the API consoles, but im a bit confused on what to do with them (possibly going to delete them).
EDIT/REDO:
I'm making a chat program, and I want EVERY copy of the program to access a folder on my personal Google Drive and get certain files from it, where ever the user is, and without him having to see the OAuth 2.0 Autorization screen(if this last step cant be skipped, I'll work with that too).
The problem is that, although i have checked the README.txt and the youtube tutorial, i still dont understand how to use the API in the way i want.
So, im asking if any of you could provide a step-by-step tutorial on how i can accomplish my goal, i.e, (Some code could be of great use):
1st-Do this;
2nd-Do that;
...
(n steps)-You are ready;
Thank you in advance!!
P.S.: this is my last "free" question, so if this specific question has been answered please comment it out.
To start using Drive API, you may may want to follow and complete the steps given in Java Quickstart.
Then to integrate with the Drive UI, you may want to check the following references:
Enable the Drive Platform - to get started integrating with the Drive UI, you need to enable the Drive API and provide configuration details in your API project. This gives you access to the API as well as access to UI integration features.
Install Your App - Google Drive lets users install an app by approving an OAuth 2.0 access request.
Open Files - this page describes how to integrate your app with these Drive UI features to open files stored in Google Drive
Hope that helps!

Accessing Data from Python GAE Datastore using Java

I have set up a Google App Engine website project using Python, with the webapp2 framework. It's neat and seems to be working perfectly. I can run queries in the backend of my website using python.
However, recently I've decided I want to have an Android (and maybe iOS) app as well as a website. The app will almost clone the website. Now, I have no idea how to query this data or access the datastore using Java, since up till now it's all been using the ndb import in Python.
How exactly would I approach this? I doubt that I need to create a new project in Java on GAE?
Has it something to do with Remote API? Looking into that now. And if so, it seems like none is available for Swift language.
Should I consider using a different Database system, and forget about GAE?
I only wish to read the data in Java, not write to the database.
For this you can use Cloud Endpoints. You expose the information you want on an API, and you consume it from iOS or Android. Here there is a tutorial that covers it.

Problems with accessing data from Google Calendar API

I want to get a users calendar events (entries) via the java google calendar API (V3.0). Unfortunately, I was unable to find any working example (tutorial) or successfully run anything. What I did so far:
I checked the APIs Explorer and successfully run some requests via the google website and my developer api key (conclusion: my API access works in theory).
I tried to follow the "Your first App"-guide. There are two ways to invoke the API: REST or client libraries. I want to use the java client library.
So I tried to set up the client library : downloaded the jars and added them to the build path (in eclipse) - as I usually do this with external jars. I now can import the classes without errors.
Here, the guide finishes abruptly if I want to use the java client library instead of directly accessing it via REST...
From here I have absolutely no idea what to do. I found a lot of examples in the web (usually for the v1.0 or v2.0 API), but was unable to run any of them. (On Google Developers I found several examples, but all for Android or AppEngine. Nothing worked...)
Does anyone of you know a very simple example to get a users events via Java library (Google Code API)?
solved it on my own. For all of you who want to start using the Google APIs in Eclipse. I highly recommend using Maven which immensely helps including the right jars (actually, it does it for you). Then try this example code (link) to start (OAuth2 authentication). You also will need a dev account and API key from google: link. Then you can start coding :) enjoy!

WURFL Java API does not identify mobile app user agents correctly

I have used WURFL Java API (also using the web browser patch) to create a standalone application for device detection. When a user agent for mobile app is used , it returns generic web browser (or blank field if web browser patch is not used) for Android and application version as device_os_version for Apple iPhone app user agents. The algorithm used in the new api as described in new api algorithms should give correct results but its not!
Can anyone help me how to tackle this problem?
I've not used the JavaAPI myself, but I have had good luck so far getting support directly from the WURFL community forums. They have a subforum for API problems. I would suggest making a post there, including the user agent string that's giving you problems and a sampling of the source code you've attempted to use before.
http://www.scientiamobile.com/forum/index.php
Sorry I couldn't give you a direct answer.

Categories

Resources