0

I have been asked about an android application that allow to employees send their feedback to a MySQL database in their company, even when they are far away, to send selling information to their manager.

I do not need codes, what I just need is a little help about this part of the project:

How to connect an android app to MySQL remotely (IP or domain name or etc...) I really don't have any idea about it.

am90
  • 201
  • 2
  • 11
  • I would recommend that you look for basic tutorials on the subject: Stack Overflow can help you with specific questions on bugs, syntax, and errors in programming: but it can't do your design work for you. Here's an example of the sort of question the Stack can answer: http://stackoverflow.com/questions/15732853/how-to-connect-android-app-to-mysql-database – Nigel Heffernan Nov 24 '15 at 16:49

3 Answers3

1

You need to host php script(host with hosting) to connect with mysql database.

CRUD functions can be done with php. And Echo data.

Another part is android - You need to call that php from AsyncTask. and get echo data and show it in TextView or else.

If you need some codes, I can show you.

First you need is to buy hosting .

1 - Create your MySQL Database.

2 - Create php on hosting to connect and CRUD msDatabase.

3 - Create App and call php Link to get data from database. If you are not only retrieving you can set parameter (eg- www.sss.com/ss.php?name="sss") to update or Insert.

Leonar Aung
  • 187
  • 9
  • if you please send some, by the way, it is a big project and my client is asking how much would he pay for this app. Do you have an idea about it ? – am90 Nov 24 '15 at 16:06
  • Hosting require about 100$ per year, domain abut 20$ per year, And + your service . – Leonar Aung Nov 24 '15 at 16:10
  • So I need to get a domain, put php script in it, so my android app use those scripts and do actions, and then the php is connected to mysql and add data ? So if my client had already a website I can use his domain to make this ? And by the way, I asked how much he should pay to me not for hosting – am90 Nov 24 '15 at 18:55
  • If your client already had domain with hosting , there is nothing more requirement on your project. Note that your php scripts need to place under any hosting if your client doesn't provide their hosing space. And normally connect mysql db and your scripts. Do transactions via php scrips to database. Get data from php by android via approach of echo or json. Fees for kind of this project in my country worth 200$ - 800$ depending on apk requirements. – Leonar Aung Nov 24 '15 at 19:41
  • I will send a link to you tomorrow ti see if this the case, thanks anyway for your help – am90 Nov 24 '15 at 20:49
  • is this a useful link to start with ? [link](http://javapapers.com/android/using-database-from-an-android-application/) – am90 Nov 25 '15 at 06:34
  • Yes, It can help you. Additional help for any specified requirement. You can also ask me here :) . – Leonar Aung Nov 25 '15 at 08:04
1

You should not connect directly to a remote MySQL. Instead, create a web service (REST) that will connect to the datasource directly, and your Android app can just hit the exposed endpoint.

Android App -> REST Endpoint -> MySQL

evargas
  • 71
  • 1
  • 1
  • 6
  • IS the web service need to buy some hosting so the app can access when it another place in the planet ? Where to buy a web hosting that is cheap ? – am90 Nov 25 '15 at 06:43
1

You probably want to add a simple web service to your server that accepts data from a mobile device.

Then on the mobile device format a JSON message and send it to the service.

mjstam
  • 1,049
  • 1
  • 6
  • 5
  • So, it would be like this: configure a REST service on MySQL, then the android part will send data using JSON to REST, and REST give it to MySQL ? Correct if this is beyond imagination :P – am90 Nov 24 '15 at 16:08