Thread: [SQL] PostgreSQL connection with Android Studio

[SQL] PostgreSQL connection with Android Studio

From
Majid Khan
Date:
Hi,


I have a postgres database running. I want an android app that need to access my database. But our developers are having problem with connecting to postgres database.

Is there any tutorial or help available how to connect to pg database from android app.


Thanks,
Majid

Re: [SQL] PostgreSQL connection with Android Studio

From
Steve Midgley
Date:
On Tue, Aug 1, 2017 at 5:01 AM, Majid Khan <mk.swati@gmail.com> wrote:
Hi,


I have a postgres database running. I want an android app that need to access my database. But our developers are having problem with connecting to postgres database.

Is there any tutorial or help available how to connect to pg database from android app.

Generally speaking most Android/iPhone apps connect to Postgres through a "middle tier" API written in Ruby, Python, Java, Node.JS or similar. In some cases you might sync Postgres to a local SQLite DB on the Android device more directly, but that would be a pretty specialized and uncommon implementation strategy.

It is a bad idea, even if technically attainable, to connect directly your Postgres database for many reasons, but most practically/immediately are security management and performance. I would strongly encourage you to encourage your developers to build some kind of API server that the Android app operates against, and connect that API server to your Postgres DB server.