Hello guys!
I'm not here for the code but more for your ideas/suggestions.
So here's the problem : I managed to make this Android application that can show my DB's records and works just as I wanted.
The code uses a PHP script to connect with a local mySql database and a JSON parser is also used.
Of course, the application works perfectly in my internet connexion since I forwarded the port 80 to my computer by loging into my router.
http://img135.imageshack.us/img135/6646/52938713.png
Now, I'd like to make it... more global?
I'd like for example to use this app in my university's network.
But I can't access the university's router... So how can I use my http://ipaddress/temperature.php script without being able to forward port 80 anymore? And is there any "static" IP adress I can use? (like, not having to change my IP adress on the code everytime I connect to a different network)
Any ideas guys how to proceed please ?
Is there a way I can still use my PHP script on any network?
Thanks in advance for any help!
Any suggestion is welcome to solve this issue.
PS : The code used looks a bit like the one here
I'm not here for the code but more for your ideas/suggestions.
So here's the problem : I managed to make this Android application that can show my DB's records and works just as I wanted.
The code uses a PHP script to connect with a local mySql database and a JSON parser is also used.
Of course, the application works perfectly in my internet connexion since I forwarded the port 80 to my computer by loging into my router.
http://img135.imageshack.us/img135/6646/52938713.png
Now, I'd like to make it... more global?
I'd like for example to use this app in my university's network.
But I can't access the university's router... So how can I use my http://ipaddress/temperature.php script without being able to forward port 80 anymore? And is there any "static" IP adress I can use? (like, not having to change my IP adress on the code everytime I connect to a different network)
Code:
try{
//commandes httpClient
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("[B]http://81.xx.xxx.xxx/temperature.php[/B]");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}
catch(Exception e){
Log.i("taghttppost",""+e.toString());
Toast.makeText(getBaseContext(),e.toString() ,Toast.LENGTH_LONG).show();
}
Is there a way I can still use my PHP script on any network?
Thanks in advance for any help!
Any suggestion is welcome to solve this issue.
PS : The code used looks a bit like the one here