文档库

最新最全的文档下载
当前位置:文档库 > 【IT专家】如何通过json将数据从php正确发送到android?

【IT专家】如何通过json将数据从php正确发送到android?

本文由我司收集整编,推荐下载,如有疑问,请与我司联系如何通过json将数据从php正确发送到android?

2013/09/26 2278 After houres of trying to find a ways I like to ask how I can send data from PHP correctly to an Android application via JSON?

?在试图找到一种方法之后,我想问一下如何通过JSON将数据从PHP正确发送到Android应用程序?

In my application I have a custom dialog, where I enter a E-Mail adress. This would be sent via JSONParser.makeHttpRequest to the php file. - This is working! When I try to send the response back to my android application it gives me following error:

?在我的应用程序中,我有一个自定义对话框,我在其中输入电子邮件地址。这将通过JSONParser.makeHttpRequest发送到php文件。- 这个有效!当我尝试将响应发送回我的Android应用程序时,它给出了以下错误:

Logcat:

?09-26 13:12:02.777: E/JSON Parser(26892): Error parsing data org.json.JSONException: Value 2013-09-26 of type http://www.wendangku.net/doc/facdbc5b4793daef5ef7ba0d4a7302768f996f5e.htmlng.String cannot be converted to JSONObject When I try to run the following php “check_mail.php” over the browser on my server it works and gives me following code:

?当我尝试在我的服务器上的浏览器上运行以下php“check_mail.php”时,它可以工作并给我以下代码:

output at normal webbrowser

?正常的webbrowser输出

?2013-09-26 11:29:43 CLIENT - SERVER: EHLO localhost 2013-09-26 11:29:43 CLIENT - SERVER: AUTH LOGIN 2013-09-26 11:29:43 CLIENT - SERVER: MzUyMjFtYWlsMQ== 2013-09-26 11:29:43 CLIENT - SERVER: eWx2dDNoOQ== 2013-09-26 11:29:43 CLIENT - SERVER: MAIL FROM: 2013-09-26 11:29:44 CLIENT - SERVER: RCPT TO: 2013-09-26 11:29:45 CLIENT - SERVER: DATA 2013-09-26 11:29:46 CLIENT - SERVER: Date: Thu, 26 Sep 2013 13:29:37 +0200 2013-09-26