Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does anyone have a short Android and Cloud SQL example

I realize that Google App Engine (GAE) is very powerful and I would like to determine the proper way to create the database schema (outside of Android) and start populating the database (once my Android app is deployed). Then I would like to query the database (outside of Android). I was hoping that this would be a 10-20 line exercise but it is turning into a much harder task that I anticipated.

Out of Band Steps

  1. Create Database via command line using proper GAE authorization.
  2. Query Database via command line using proper GAE authorization.

I want to reiterate that I don't want to write Java code to create or query the database. I am more interested in using SQL or a SQL-like language directly vs. using Java.

Android Steps

  1. Insert rows into the database using proper GAE authorization, encryption, etc.
like image 976
AG1 Avatar asked Feb 25 '26 03:02

AG1


2 Answers

Here are two ways to issue SQL statements to your Cloud SQL instance:

https://developers.google.com/cloud-sql/docs/commandline

https://developers.google.com/cloud-sql/docs/sql_prompt

As for inserting rows into the database from Android, you'll need to write a GAE app to act as a proxy. The app can then expose a REST API or whatever API you want.

like image 54
Ken Ashcraft Avatar answered Feb 27 '26 17:02

Ken Ashcraft


I realise this is an old post but for people finding this via search, the link below is relevant and includes a sample android code:

https://developers.google.com/appengine/docs/java/endpoints/consume_android

Also, the Google Eclipse pluging also supports creating an App Engine Android project, see: https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae

like image 20
sham Avatar answered Feb 27 '26 15:02

sham