1

Hello every one i m amazed cause my android application was running very well on my samsung galaxy tab 2 but now i have this error on logcat.

org.json.JSONException: Value <.doctype of type java.lang.String cannot be converted to JSONObject

i've open port to fire-wall and configure mysql to remote access & phpmyadmin based on youtube video.

so i need help cause i don't know what to do !!?

i 'va see the response of provided on JSONException: Value of type java.lang.String cannot be converted to JSONObject

tks

and i have some error like http 403

4
  • It seems the input your parsing as JSON is XML now. Try logging it to check if it's a valid JSON or not. Commented Sep 8, 2013 at 9:22
  • When i execute php script i've this result [{"NOM":"QUINCONCES","Latitude":"35.702231","Longitude":"-0.65375"},{"NOM":"PEZERAT","Latitude":"35.691835","Longitude":"-0.624724"}] Commented Sep 8, 2013 at 9:36
  • I am guessing when you're making the request you're not setting the proper response accept type. as a result you get xml and sometimes json. Commented Sep 9, 2013 at 2:59
  • hello plz when I display the string ,I get received some error http 403 what i should do ? Commented Sep 10, 2013 at 8:54

2 Answers 2

1

i find the solution it's about apache server configuration

<Directory "/home/domain/www">
    Options +Indexes FollowSymLinks +ExecCGI
    AllowOverride AuthConfig FileInfo
    Order allow,deny
    Allow from all **here you need to change deny from all to Allow from all**
</Directory>
Sign up to request clarification or add additional context in comments.

Comments

0

Another solution for those who didn't find it yet:

My device was connected to VPN while trying to connect to outter address, so I didn't get JSON, but a webpage saying that firewall blocked my attempt (VPNs firewall).

So if you're certain that your php file returns valid JSON, check your StringBuilders response, it might be some error or warning accessing the location.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.