- Home /
Android | online database
Hy all, I would like to create a game for Android, and I would like to be able to connect to an online database, I have documented but I still have a lot of confusion, If I create a database in MySQL I can put it online? (Registering the domain)
once put online, I can do that from the game I can read the data stored in it?
Sorry for the bad english, Thanks in advance
As another alternative there are relatively free third party services that will do the database side for you. Parse is one I use, but there are others.
Answer by Graham-Dunnett · Sep 19, 2014 at 02:43 PM
This is not really a Unity question. Typically you have a web server, which has some PHP or similar that talks to the database. You can then make GET and POST requests to the PHP to read and write data. On the Unity side you just need to use the WWW
and WWWPost
classes.
so i should do a database linked to web software that talk with Unity Project?.... can u link here a guide than can explane me this ? tnx
regarding the safety, this way is safe? because i read that a sniffer can easily take pass and acc of database from the script
Answer by SuperMasterBlasterLaser · Sep 19, 2014 at 03:17 PM
Read something about RESTful services. You have server (written in Java, .NET, PHP, etc) hosted on the internet. You create POST, GET HTTP requests to your server. Server handles your request and sends response (JSON, XML or simple String). Inside Unity you should read something about WWW, WWWForm.
I managed to make any connection between unity and the database using the WWW form, But when I mount the apk and run, tells me that it can not connect to the database ... any idea ??