How can we write to a printer in GAE? - java

We are porting our application over to GAE and one of the options it has is to render to a printer? Is this possible in GAE (being in the cloud it may not have the concept of printers). If so, how is that done? (Google search does not appear to show anything.)
thanks - dave

We have used Google Cloud Print in the office before where you can configure your printers and share them using Google Cloud Print. Here are a list of Cloud Ready Printers. There also seems to be an API for Cloud Print which I believe you can explore calling from your GAE servers using the URL Fetch service, authentication is managed using OAuth2 for which you can use the OAuth2 client libraries.
I think the first step is to check if you need to keep your existing printers and if they can be added to Google Cloud print, if this is possible then you can explore using the Cloud Print APIs from your GAE App, see the following links in the docs:
https://developers.google.com/cloud-print/docs/proxyinterfaces
https://developers.google.com/cloud-print/docs/devguide
If your printers do not support cloud print unfortunately you might have to develop and expose your own API that accepts jobs and sends them over to network printers

Related

Using OAuth for Google App Engine Endpoints from third party servers

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

sendgrid implementation without billing account in Google App Engine web project?

I am using sendgrid APIs to send bulk emails.We have cloud application in android and web using google app engine.As we know google app engine has limited quota.So we supposed to use FREE i.e.12k/month to send emails.We have integrated it properly.If I run the code at local side i.e. localhost:888, it works but if I deploy the code and try it from there then I am getting below exception.I have created an account on sendgrid already and verified as well.
com.google.apphosting.api.ApiProxy$FeatureNotEnabledException: The
Socket API will be enabled for this application once billing has been
enabled in the admin console
Is it really needed to have billing account?
You can use sendgrids web api which does not require the Socket API in App Engine.
If you want to use sendgrid's SMTP API you will have to enable billing. I would recommend using the web api though.
They have an example i successfully use in one of my projects.

How to use OAuth2 in Google AppEngine to call an API in java

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.

App Engine + Google Documents

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.

Access Twitter or Facebook API from Java ME app?

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!

Categories

Resources