0

I am developing an app in Rad Studio XE6 (Delphi) which access an Oracle DB in a server. So far I have tested it using my personal laptop as a server which hosts the DB. The client is being created in Delphi and I installed it on my android phone. Both are in the same wifi network (Laptop and android device).

Up to here, everything works perfectly.

But, I tried to get connected to my laptop and get the data base using 3G connection... this did not work.

Looks like my android device never reaches the server (my laptop).

Do somebody know what do I need to do in order to make my app working through 3G to reach the database server?

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
  • Can you access the web services may be from the browser of your phone using 3G? Since via wifi the phone and the server are directly connected, via 3G they are in a separate network. So i guess you will need static IP(one given by the ISP) to access the laptop DB and then use it to access the DB server – PresleyDias Aug 03 '14 at 17:15
  • Wow, that is an awesme suggestion :) I did not think about it, let me try, that will giveme a lot of information about the issue. Thanks a lot buddy!!! :) – Ricardo Rodriguez Aug 03 '14 at 22:48
  • try this too [3g wifi android](http://stackoverflow.com/questions/3312065/my-app-works-over-wifi-but-not-over-3g-in-android-any-guesses?rq=1) – PresleyDias Aug 06 '14 at 17:19

1 Answers1

3

It's a networking error, not a programming error. You have a firewall, possibly at the ISP level, blocking you from the db. You also probably have at least one layer of NAT in there.

As an aside- you should NEVER connect directly to a db, for 2 reasons. First off, it requires your db server to be publicly accessible and thus more open to hackers. Secondly, it requires you to put the password in the app, which means anyone can decompile the app and get the password. Instead you should put a web service between them, so only the web server needs to connect to the db.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • First of all, thanks a lot for your answer :) I forgot to mention that yes, I am using a web service to provide the data. So, the web service is connected to the DB and I need to get connected to the web service from the android client. So maybe it is a firewall issue, right? Thanks again. – Ricardo Rodriguez Jul 31 '14 at 14:46