Google Cloud SQL Backend - google-app-engine

I've started developing for GAE (Google App Engine) and I want to build a REST API using Google Cloud SQL. I currently have a web app in App Engine that works well with Google Cloud SQL but I need to build an API to provide REST services for Android and iOS or any other technology capable of consume web-services.
I've read many docs in Google about Mobile Backend Starter, Endpoints, etc. I'm not pretty sure how to integrate with my existing Cloud SQL Database. I think I'm almost near to get what I need.
If someone knows a tutorial or documentation to achieve what I need, please share it in here.
Thanks!

I've found what I needed!
If anyone tries to implement Google Cloud Endpoints using Google Cloud SQL, Python with Django, please follow this tutorial You will be able to build a RESTful API with your existing Django Models.
Also, here's a Youtube Video from GDL which explains very well how to use ProtoRPC for Python and build your Google Cloud Enpoints APIs. ProtoRPC is a framework for implementing HTTP-based remote procedure call (RPC) service.

Related

Does Google provide support for Google APIs for vaadin if not using google app engine as a runtime..?

I am new in vaadin and developing a web project so want to know if i do't use Google App Engine as my project's run time environment so that am able to use Google all APIs such as:
*Calender API
*Contact API
*Drive API
* and also other which google provide :
Google APIs
As i get to know that GAE has lot of limitations.
Please suggest me for the structure design of an Enterprise project with
Maven+vaadin+Runtime Environment(Jboss)+Eclipse+MySQL
Google APIs does not require your application to be running on Google App Engine unless of course you’re trying to use an App Engine specific API like this.
If you’re seeking suggestions on how to structure your project using Google App Engine, you may want to do so in official App Engine Google Group as such questions can be considered too broad on stackoverflow.

how can I use google app engine with an application in phonegap

I have been developing a Phonegap client application, I need to create a web service that storage all the data that i will be sending through the app.
I want to use google app engine to create the database and the web service.
I have read a lot, but i don't find a concrete example of how to do it and how to call the web service then from the application with phonegap.
Anyone have an example of how to do this?
You can use Cloud Endpoints with your app:
Google Cloud Endpoints consists of tools, libraries and capabilities
that allow you to generate APIs and client libraries from an App
Engine application, referred to as an API backend, to simplify client
access to data from other applications. Endpoints makes it easier to
create a web backend for web clients and mobile clients such as
Android or Apple's iOS.
For mobile developers, Endpoints provides a simple way to develop a
shared web backend and also provides critical infrastructures, such as
OAuth 2.0 authentication, eliminating a great deal of work that would
otherwise be needed. Furthermore, because the API backend is an App
Engine app, the mobile developer can use all of the services and
features available in App Engine, such as Datastore, Google Cloud
Storage, Mail, Url Fetch, Task Queues, and so forth. And finally, by
using App Engine for the backend, developers are freed from system
admin work, load balancing, scaling, and server maintenance.
It is possible to create mobile clients for App Engine backends
without Endpoints. However, using Endpoints makes this process easier
because it frees you from having to write wrappers to handle
communication with App Engine. The client libraries generated by
Endpoints allow you to simply make direct API calls.
Available in Python | Java
we have done similar thing for our Cordova/ionic based application. Its very simple and straight forward using javascript client of google cloud endpoint.

Best JavaScript Client Libraries to do OAuth2.0(Google) and access Google CloudEndPoints in phonegap?

I have been developing an online accounting software which is a web application. We use Secured Google Cloud Endpoints in our project. Now I would like to securely access those endpoints in phonegap. So, for that I would like to do OAuth2.0(google) and access my API securely. I have been struggling for a while to find good JavaScript Client Libraries to access my Secured API in phoneGap.
Please help me...
Any replies would be appreciated.
Finally After some struggle I have figured out the solution. If we are trying to do Google OAuth in phone gap its better to use normal JQuery and for calling the Secured Google Cloud Endpoints we can go with Google JavaScript Client Libraries. I have found a sample project oauth-google-api-gapi-phonegap-childbrowser-jquery which is a very good start for the beginners.

GWT and Google Docs API

I'm using GWT to create a simply app that allows teachers to create easily their own lessons.
The App is going to be on Google App Engine but I want to store lessons in user's Google Docs space .
Is it possible?
As far as I know gwt transforms java into javascript but google docs api is java, do i have to upload the java library to de app engine storage?
any place to start? any advice?
Thanks...
You need server side proxy for GWT client.
Your GWT client communicates with the servlet. The servlet is the actual agent using the google docs API.
Please read my explanation at http://h2g2java.blessedgeek.com/2010/05/accessing-google-userservice-from-gwt.html.
It explains how to get a GWT client could communicate with a Java based Google API. It explains that since GWT requires all Java source involved to be available to the GWT compiler, there are cases that you simply cannot get GWT client to do the task directly.
http://h2g2java.blessedgeek.com/2009/08/tablemgr-gae-gwt-gdata-with-rpc.html similarly explains how to combine gae + gwt + google docs, using the proxy approach. The posting is quite old and therefore the web site it points to does not work anymore because I have not updated the gae app with google mandated authentication measures. But it should work on your local machine.
The above subscribes to a webserver flow paradigm.
However, Google APIs are essentially REST APIs, which allows you to access them directly using your javascript or GWT client. So, instead of using the Java docs for Google APIs, you need to read the Google REST API docs.
http://code.google.com/more/, among other whatnots, provides a list of all the Google cloud APIs. To avoid using the webserver-proxy flow paradigm, choose the javascript or REST version of the API docs.
Here is the google docs/data API:
http://code.google.com/apis/gdata/docs/client-libraries.html.
Choose the javascript API:
http://code.google.com/p/gdata-javascript-client/
I advise you to first practice using these APIs by coding in javascript. Then you would get a good grasp of what you need to do in GWT.
You should use the GWT API for authentication prior to accessing the Google REST APIs.
http://code.google.com/p/gwt-oauth2/.
Essentially, you are obtaining an authenticated token which your client could use to access Google's data thro their REST APIs.
FYI, REST APIs are, in plain speak, URLs in a defined specification, where data transmission is by convention mostly in JSON or XML.

Salesforce's Database.com and Google App Engine via JPA

Currently i try to connect (via JPA/Datanucleus) with an application, hosted by Google App Engine, to the database service of database.com (Salesforce)
After many hours of reading and trying, i could not find any solution.
So, is it even possible??
Some Information....
Database.com provides JPA: http://forcedotcom.github.com/java-sdk/jpa-provider, but i could not found any sdk on this side, but i found a jar-file hosted by grepcode http://grepcode.com/snapshot/repo1.maven.org/maven2/com.force.sdk/force-jpa/22.0.7-BETA/ - Possibly there is currently no official release ...
The problem is that this SDK from Salesforce needs datanucleus 2.0, but Google App Engine includes only datanucleus 1.1.5. So i try to update theses libaries and found this.... code.google.com/p/datanucleus-appengine/ . I tried a few hours to replace the old libaries and to use the newer, but unsuccessfully. The error was that eclipse could not find some libaries, because the newer libaries, provided by the side above, have different package structure -
I am thankful for any help...
Kotake
The official release of the JPA provider is available on Maven Central:
http://search.maven.org/remotecontent?filepath=com/force/sdk/force-jpa/22.0.7-BETA/force-jpa-22.0.7-BETA.jar
The external connection restriction won't be a limiting factor because the JPA adapter connects to Database.com over https using a SOAP API.
I can't speak to the challenges around getting DN 2.0 running on GAE. Perhaps GAE support can help with that?
As stated here in the App Engine docs, you cannot make direct connections to external servers from GAE (except over http or https using the app engine specific url APIs). You will need to find some other way to get data out of your remote database.
This link describes how to solve your problem:
How to use Force.com Database SDK on Google APP Engine
(He has updated the Saleforce SDK source code to allow it to work without problem on GAE.)

Resources