Click here to Skip to main content
15,891,654 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am try to create app the post data to my web site and retrieve the result first I try my android code by retrieve json data from http://services.hanselandpetal.com/feeds/flowers.json and it is work fine

but the problem that I tried to retrieve the same data from my web site using the same android app. and the same problem that I try to retrieve these data

/* Output header */

$data = array("result" => 0, "message" => "Error!");
header('Content-type: application/json');
echo json_encode($data);
?> please Help me and thanks so much for every one.

What I have tried:

I have retrieved the same data from other site and it is work fine
but my site did not work
Posted
Comments
Richard MacCutchan 28-Feb-16 11:26am    
What does "but my site did not work" mean? What message is returned from your site?
Member 11536190 28-Feb-16 11:30am    
thanks bro for response
I display the result by
@Override
protected void onPostExecute(String result) {

Toast.makeText(getBaseContext(),result,Toast.LENGTH_LONG).show(); }
my site show null message
Richard MacCutchan 28-Feb-16 11:39am    
That does not help much. I suggest you use your debugger to find out exactly what data is being returned from your website. Silly question: are you sure your website is returning the json data? Easy to check by typing the URL in your browser.
Member 11536190 28-Feb-16 11:45am    
yes I am sure that my web site return json data
http://strontaxi.com/webServices/presentation/json.json
Richard MacCutchan 28-Feb-16 12:07pm    
Then my previous comment stands. You need to use your debugger to find out why your Android code is failing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900