The issue will be in the code which is performing the request to the server and receiving the response (or possibly with the server itself). If you can, please post the code here (be sure to obfuscate any credentials or URLs which might be confidential).

Now that you have posted more code, we can see that your code is expecting that the server will provide a response with content which looks like this:
but from your logging, it appears like the response looks like this:

Harry Burke

Greenhorn

Posts: 15

posted 3 weeks ago

This is the LoginActivity.java page. The login form on the app is filled in, then it goes to a login.php page to see if it's in the database.

It's just that I don't understand JSON well enough to figure out the error I'm having.

You could try this to specify to the server what type of response payload you want:
If that doesn't address the issue, then you may need to check the server side to get its perspective on what is happening.

Harry Burke

Greenhorn

Posts: 15

posted 2 weeks ago

Unfortunately that didn't solve the issue, I'm still getting to the same point as before.

I might have missed it, but are you actually getting an exception with stack trace in your logs?
I noticed you are using e.printStackTrace() in your catch blocks. Since you have a proper logging framework I would suggest replacing those with Log.e(LOG_TAG, "Some message", e).

Harry Burke

Greenhorn

Posts: 15

posted 2 weeks ago

Hi,

I have attached a picture of the error message that is now coming up in the LogCat.

Would anyone be able to let me know how I could go about fixing it?

Thanks

code.PNG

Dave Tolls

Master Rancher

Posts: 3887

45

posted 2 weeks ago

As Ron has said, though.
That is simply not a JSON string, and that's why it's complaining.

Are you sure you should be getting JSON back from the call you made?
It looks to me like you're just logging into somewhere, and the response is simply saying you're connected.

(Also, it's easier for us here if you can copy/paste the errors rather than showing a screenshot)

All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad: