U
U
uaSaint2014-01-24 13:40:22
Android
uaSaint, 2014-01-24 13:40:22

Why is Android json response breaking?

Good day to you people.
The essence of the problem is that when sending a request to vk.com, of the form:

url = "https://api.vk.com/method/photos.get?owner_id=<тут_был_id>&" +
                "album_id=saved&rev=1&extended=1&v=5.7"

the answer is incomplete. Those. the result in a particular case is approximately 1.5-2k photos, I get no more than 10 different sizes, and then the answer simply breaks off at some symbol. The goal is simply to try to understand how it works. I need to use exactly public methods without registering and receiving tokens. And I do not see a way to limit the request (i.e. ask for ten, ten more, etc.), photos.get - has a limit in the parameter, but it makes no sense, because I can only limit the result and always receive, for example, only the first 10. Everything I do with the answer now - I just output it to the log, I didn’t try to move further. because nothing works so far. Code example:
String url = "https://api.vk.com/method/photos.get?owner_id=<тут_был_id>&" +
                "album_id=saved&rev=1&extended=1&v=5.7";

        AsyncHttpClient client = new AsyncHttpClient();
        client.get(url, new AsyncHttpResponseHandler() {

            @Override
            public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
                super.onSuccess(statusCode, headers, responseBody);

                String logString = new String(responseBody);

                Log.d("LOGTAG", logString);
            }
        });

The question is how to get a complete answer, or where to save it if the problem is in size .. Well, or how to correctly form a question in google :(

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Krainov, 2014-01-24
@uaSaint

Are you outputting the result only to the log? If the string is large, then it is always truncated when outputting. Tried to look through debug the necessary variable?

M
mousexaker, 2014-01-28
@mousexaker

Or try to write the answer to a file. The fact is that the debugger also breaks the line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question