0

I am currently developing an android app that require to talk with mysql server and php files to share json strings , however I am testing my app using my own device and only when i am connected with the same Network of my pc ,

though if I want to make a presentation of that app I want to talk with the php files that are on the internet , so i host them on the internet and switch my url hard coded for the application to work

my question is : is there any way to make my app check in what network it is at and switch from url1 to url2 without me going and change it hard coded ??

I don't know if someone understood my goal but i hope you guys can help me

Sora
  • 2,465
  • 18
  • 73
  • 146
  • Here is similar question please check if this help you http://stackoverflow.com/questions/4860365/determine-in-php-script-if-connected-to-internet – edrupler Jun 23 '16 at 16:50
  • As i understand you want to switch between public and private ip. If device at the same network with server it will use private ip. Otherwise it will use public ip. I solved a similar problem like that. – ekilic Jun 23 '16 at 16:51
  • yes this is my question – Sora Jun 23 '16 at 17:00
  • Before execute request, you can get connected ssid from wifimanager. If connected ssid equals your local network ssid this means device in local network and use url1 otherwise use url2. If that will solve your problem, i can share code – ekilic Jun 23 '16 at 17:10
  • yes please this is what i was asking – Sora Jun 23 '16 at 18:18

0 Answers0