-7

I have a database server in local. (it means running when I type 192.168.1.1, not upload this database onto web) and I want my android device connects to this database server to get data.

My android device and database server is same on wifi network. So how can my android device can connect to this computer so can get data from database server, please teach me.

thanks :)

hqt
  • 29,632
  • 51
  • 171
  • 250
  • May be these links can help you http://stackoverflow.com/questions/5806220/how-to-connect-to-my-http-localhost-web-server-from-android-emulator-in-eclips http://stackoverflow.com/questions/4779963/how-can-i-access-my-localhost-from-my-android-device – Girish Nair Mar 21 '13 at 12:55

2 Answers2

2

I don’t think you should access the DB server right away from Android App. You need to have a web service implemented to talk with your db server. Web Service can function as the layer between your DB and Android App.

If you use the web service deployed in the same local area network which is connected via Wifi, then you can use the IP of the machine which has hosted the Web Service to access the web service from your Android App.

Else just deploy your service to a web host and directly call the service from your mobile app.

Jay Mayu
  • 17,023
  • 32
  • 114
  • 148
1

Try using web services. This way you can retrieve and update the database of your server. Besides after completion of development your app will usually not be on your local machine.

Its not blank
  • 3,055
  • 22
  • 37