I am making an app which requires a database, so I want to use PostgreSQL from Google Cloud Platform, I did not find any tutorials helping me to do that, How to access the data? a link at Can i use PostgreSQL or mySQL in android App development no longer works or outdated, found the REST API documentation for Cloud SQL but unable to understand if these APIs are just to access DATABASE or the data inside DATABASE?
-
1Please visit the link : stackoverflow.com/questions/23298590/…Deepak S. Gavkar– Deepak S. Gavkar2019-09-05 05:42:33 +00:00Commented Sep 5, 2019 at 5:42
-
1Possible duplicate of Can i use PostgreSQL or mySQL in android App developmentJGH– JGH2019-09-05 11:24:45 +00:00Commented Sep 5, 2019 at 11:24
1 Answer
As mentioned in the accepted answer to the post suggested by @JGH, there are a few ways to access data of a DB from an Android App.
The most commonly used way is definitely by communicating to a service hosted on a server that can connect to the DB, and provides endpoints to request any operation (read, write, update, delete).
However, since you specified a direct connection from the Android App to the Cloud SQL instance, the best option would be to try to make it work with the JDBC connecting to, possibly, a public IP of the Cloud SQL instance. You may find more information in the Connecting to Cloud SQL from external applications documentation.