我是新来的PHP,我开发的Android到PHP的Web服务,这是在本地主机工作正常。我要让我的应用程序生活,所以我上传了我的PHP文件在浏览器byethost17.com
,它工作正常,返回JSON但是当我运行我的应用程序的显示字符串不能转换为JSON
org.json.JSONException: Value script of type java.lang.String cannot be converted to JSONObject`
的代码工作正常使用JSON从本地主机解析时,问题来自免费托管网站。什么是解决方案?有没有好的免费网站托管网站? 100%免费?
org.json.JSONException: Value <html><body><script of type
java.lang.String cannot be converted to JSONObject
at org.json.JSON.typeMismatch(JSON.java:111)
at org.json.JSONObject.<init>(JSONObject.java:160)
at org.json.JSONObject.<init>(JSONObject.java:173)
this is result from browser when hit same url
{"data":[{"Category":
{"Category_ID":"3","Category_name":"Camera","Category_image":
"upload\/images\/7089-2015-07-09.png"}},{"Category":
{"Category_ID":"9","Category_name":"Cars",
"Category_image":"upload\/images\/7789-2015-07-09.png"}},{"Category":
{"Category_ID":"4","Category_name":"Clothes",
"Category_image":"upload\/images\/9350-2015-07-09.png"}},{"Category":
{"Category_ID":"1","Category_name":"Computer",
"Category_image":"upload\/images\/1843-2015-07-09.png"}},{"Category":
{"Category_ID":"7","Category_name":"Music",
"Category_image":"upload\/images\/8666-2015-07-09.png"}},{"Category":
{"Category_ID":"5","Category_name":"Other",
"Category_image":"upload\/images\/6260-2015-07-09.png"}},{"Category":
{"Category_ID":"2","Category_name":"Smartphone",
"Category_image":"upload\/images\/3025-2015-07-09.png"}},{"Category":
{"Category_ID":"8","Category_name":"Sports",
"Category_image":"upload\/images\/5354-2015-07-09.png"}},
{"Category":{"Category_ID":"10","Category_name":"waqas
Company","Category_image":"upload\/images\/9853-2016-04-11.jpg"}}]}
W帽子字符串,你想转换为JSON? –
其在线商店的产品数据,我发现这个qurstion类似于我的问题http://stackoverflow.com/questions/33439515/problems-in-parse-com-php-hosting –
任何人都可以告诉我免费托管网站谁给我正确的JSON ???????? –