• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I interlink JSON string which created by Gson library, with HttpURLCOnnection api and PHP?

 
alex friday
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created this JSON sting by the Gson libary:



and I want to send this data every 60 seconds to the server via httpURLConnection api from the Asyntask class I tried it with the aid of WAMP but I am not getting any ouput of doInbackgound.



I used this URL in the case of WAMP: http://192.168.134.45/connection.php where 192.168.134.45 is my Wifi ip address.


PHP connection file with the default WAMP setting.


 
Paul Clapham
Sheriff
Posts: 21588
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you aren't getting any output from doInBackground, that would have to be because you aren't calling it. Otherwise your logging code at line 5 would be executed and you would be seeing output at wherever System.out is pointed at.
 
alex friday
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry I meant I am not getting output from


I am getting the JSON String in doInBackground method:



I want to send the JSON string from my smartphone device to the XMAPP mysql.
 
Paul Clapham
Sheriff
Posts: 21588
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alex friday wrote:sorry I meant I am not getting output from


Then an exception is being thrown before that line is reached.

I want to send the JSON string from my smartphone device to the XMAPP mysql.


Have you checked that your smartphone's IP address is in the same local network as that server?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic