DATABASE CONNECTION IN ANDROID

  • Replies:1
Masu S
  • Forum posts: 1

Mar 30, 2017, 6:18:14 PM via Website

hi friends,
i want to create a application on android and vb 2013.i want both applications to share a common database to fetch data from a database.i want to know which database is feasible for this and i want to know how to connect that database from android

Reply
Marc Moissat
  • Forum posts: 3

Apr 6, 2017, 2:17:40 PM via Website

There are 2 ways :

1) Expose the DB directly to network/internet.
2) Expose a service which read/write data from DB and call it from your apps.

In option 1), the simplest in term of architecture, you can use any DB that offer jdbc connectivity ( such mysql, oracle...) and perform request from your java code using a JDBC driver.
You need to enable the SSL flag on the client side to get a secure approach.
EX : razorsql.com/articles/mysql_ssl_jdbc.html

In option 2), the more professional, you will write code on a server (can be PHP, java web server or other) that will allow you to perform a HTTP request from your android application in order to retrieve the data through your service.
Note that you can easily secure this service using HTTPS and a basic authentication.
This solution is perfect to factorize some code related to datas for both applications.

Pablo Kasimiri

Reply