Can i use PostgreSQL or mySQL in android App development

前端 未结 2 1149
梦如初夏
梦如初夏 2021-02-01 11:23

i am new to android development. i am developing an android app for a university management system. Can i establish connection with database like postgreSQL or MySQL in android

相关标签:
2条回答
  • 2021-02-01 11:35

    Android has an inbuilt sqlite database that you can use within your app. You can also access virtually any other database system via an API.Have a look at this link http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/ and http://www.tutorialspoint.com/android/android_php_mysql.htm

    0 讨论(0)
  • 2021-02-01 11:45

    You have three main choices:

    Direct connection to database

    You can connect the devices directly to your database with JDBC driver.

    http://www.basic4ppc.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/

    This is not your best choice if you want to maximize the security of your system.

    Web services

    You could deploy a REST service on a server that connects to your database, and the android app should communicate with this service if you want to make any operation (read, write, update, delete) in your database.

    You have a lot of tutorials about how to deploy REST web services in your fav language/framework.

    DJANGO = http://www.django-rest-framework.org/tutorial/1-serialization

    NODE = https://github.com/mcavage/node-restify

    RAILS = http://old.thoughtsincomputation.com/posts/understanding-rest-in-rails-3

    This is the most commonly used stack for android apps that needs database. Next, you have a nice tutorial here for how to connect to REST service via Android:

    http://blog.strikeiron.com/bid/73189/Integrate-a-REST-API-into-Android-Application-in-less-than-15-minutes

    Local database

    Maybe is not what you want, but you can access to local SQLite database in your app. You can deploy your apk with the database asset inside or just download the database file from a server

    Hope it helps!

    0 讨论(0)
提交回复
热议问题