Question

I've been reading through developers.google for a few days now and this process is still confusing me.

As far as I can tell, I need the following:

  • An Android application

  • A Java App-Engine backend that uses Endpoints (still not quite
    understanding what these are).

  • Code within this backend that connects to my Cloud SQL instance.

My problem is that none of Google's examples seem to have an Android/Cloud-SQL example.

I've been using this guide on how to create an Android app with App Engine backend. But then it uses Google datastore stuff, I think? I need to use SQL rather than this.

In this guide there is mention of App Engine, but for a JSP web form front-end, and no mention of Endpoints.

So my questions boils down to, have I got the right idea with using EndPoints + Cloud SQL, and if yes, how does one achieve this? I'm quite a JDBC newbie in general, so I'm not quite sure how to achieve this off the top of my head.

Was it helpful?

Solution

you are on the right track.

Just for the record, if you don't have strong reasons (yet) to go for a SQL data store, do consider using Google Data Store as it is better seamlessly integrated into the SDKs and after a couple of compromises it should help you pushing your data design to scale nicer.

Let's split it into parts:

  1. First you have your backend/api. This is basically your piece of code that operates on Google servers, which you'll access on an remote connection basis (http, socket, etc) - (same as most of the APIs we know work). I don't know which programming language you are using but here is some basic set up for your project and Cloud SQL on Python.

  2. Cloud Endpoints is nothing more than a very cool feature that App Engine brought recently to avoid all the mess of creating and updating your client libs over and over again. It basically automates that task for you, by using annotations or references you put in your backend code to create client libraries for Java, Objective-C and JavaScript that you can then integrate into your clients.

    Example: Let's say I have a controller on my api to operate with bananas, that has a method to delete a banana from the api. Annotating that method on your api code, will let endpoints script know that this methods is there to delete bananas, thus it'll gather it and include it in the generated clients libraries, so that you don't have to do that manually for any of your clients, nor every time you update you api code. [Here's] some documentation.

  3. Android Application. That's certainly your business :) But I'm sure having your api libs already generated already helps a lot.

Hope it helps. Let me know if you need to get more into detail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top