Recent

Author Topic: Connect to database  (Read 1903 times)

m4u_hoahoctro

  • Full Member
  • ***
  • Posts: 160
Connect to database
« on: July 07, 2015, 02:37:14 pm »
I researched about socket, httpclient, I created an android app connects to server by TCPSocket
Now I want to connect to database on server, get datas and show them, but I don't know how
I read this tutorial http://wiki.freepascal.org/MySQLDatabases , I intended to use it for my app, but my friend said MySQL/SQLite can't run on android


taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Connect to database
« Reply #1 on: July 07, 2015, 04:08:55 pm »
I have no idea if mysql has a client library for android but as far as I know the default database in android is sqlite. In your case I would use a 3tier design talking to a webservice on a server that will retrieve the data from the server and show them to you. This way you do not need to wait for mysql to support any OS/device you application runs on.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Connect to database
« Reply #2 on: July 07, 2015, 05:15:33 pm »
If this kind of app exists on google play, then mysql (not just its client library) should be available for android. Finding that ported client library is another story, I don't think Oracle provides a pre-compiled binary so one will need to compile from source but even this is not guaranteed without tweaking. Happy hacking!

SQLite is of course supported on Android since even its core functionality depends on it.

 

TinyPortal © 2005-2018