This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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: 21945
36
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: 21945
36
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?
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!