I'm developing a Java ME app and I want to give it social features. Is it possible to connect to Facebook or Twitter directly from the app, without an intermediate server?
These API's are just HTTP when it comes down to bits-on-the-wire. Java ME supports HTTP with the classes in the javax.microedition.io.* package.
http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/Connector.html
http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/HttpConnection.html
It's been a while but ISTR having to use GET and POST for everything when using these, no RESTful PUT and DELETE.
Java Client Libraries for the Twitter API
Facebook access for Java
Those should get you started.
You don't need to use any type of middleware or anything to access services that expose an API, but you will need a client library that either you or somebody else has built (like the ones linked to above).
Good luck!
Related
I need to know if I write Rest API in JAVA using Spring framework and I will be using it in angular js front end, is it possible to use the same API's for Andriod app later. Is it a good to use same api's for both web and app, I have no idea about android development, please help.
If your API is RESTful, and by that I mean at least stateless and resource based. Then yeah, it doesn't matter what program you're requesting data from.
If your are able to process the response into your front end (reading the format, etc). It'll be fine. Just make sure your API's endpoints work correctly and are configured to handle the request your programs will be using to communicate with your API (most of the times these are http requests)
I have a Google App Engine application deployed which contains and manages user data. My users may want to share their personal data with third party sites. Think Garmin sharing running data with myfitness pal or Strava.
The google documentation is gives good examples for using endpoints with iOS, Android, and javascript based web apps. These examples use a client id but not a "client secret" and do not involve refreshing the access tokens.
I have a javascript app running on a third-party site that does one time lookups against the api well.
I’d like to create a sample server app, preferably in java, that would connect periodically using an assigned client secret and refresh access tokens.
I have found documentation for accessing Google API's at the second link below but it is not clear if "Google APIs" include Google App Engine endpoints or just the standard suite of google apis.
What is not clear to me is that at the first link the documentation suggests that a client library needs to be generated from the backend endpoint api using maven or the endpoints.sh tool. Examples are provided for iOS/Android but there is no discussion for third party access.
Does anyone know is the server access configuration I describe possible with custom endpoints? Has anyone encountered example code for a server app that uses refresh tokens against an endpoint api?
Thanks!
End Points Documentation:
https://cloud.google.com/appengine/docs/java/endpoints/auth
OAuth Documentation:
https://developers.google.com/identity/protocols/OAuth2InstalledApp
https://code.google.com/p/jsonengine/
I have uploaded it to my app engine, I can see the Admin Panel but i'm not sure how I can use it to make json requests.
Do I have to write my own classes or does it do it automatically?
Can someone explain to me how this library works. I have read the wiki many times and I don't get it.
Can I use this library to make json requests from my mobile app to list/update/create records on the server?
JSONEngine is a RESTful database. It is not a library to make JSON requests, it is a library to store/retrieve/handle JSON requests. Its not a library, its a server.
You can read/write data to it by making HTTP calls, as documented in their Usage Guide. Its up to you to decide how (or what library) that you want to save/retrieve data from this JSONEngine. There are dozens of Java libraries for accessing REST API, such as UniRest for example.
| Can I use this library to make json requests from my mobile app to list/update/create records on the server?
Nope, again this is not a library, its a server. You can use any Java REST library to make calls to store/retrieve data from this JSONEngine server.
EDIT: Additional clarification
I have a web application hosted in Google app engine and i need to handle some APIs (calendar). I need to authenticate the user via OAuth and to call an API.
I'm going to guess you are talking about the Google Calendar API, since you didn't specify. Information about using the Google Calendar API (in Java) is here. The document isn't specifically tailored to App Engine, but you can see some App Engine examples in the client library distribution.
You can try scribe-java. It works on GAE. Or maybe scribe-up which is an extension to it and supports getting user profiles out of the box.
What is the best way to access Google Documents (documents, spreasheets etc from Google Apps or Gmail) using Java on Google App Engine. We are using GWT on the client side.
Thanks,
Carl
The Google Data Client for Java suppose to work on the Google App Engine.
It gives you access to must of Google Apps Services.
Google has Google Client API which probably has a better support for OAuth2, json and support for the API discovery, but still The old API should work.
Read about Migrating To Google Api Java Client this should resolve any confusion you might have.