Update on the Pagination issue in Raccoon

Ok, I spent some time on figuring out why pagination is broken in Raccoon. About half of what I wrote previously is wrong. So much for trying to solve a problem late night. Current state of knowledge:

  • I was wrong about the protocol for requesting additional pages of search results: they are still addressed by query, offset and length, e.g. search?q=list+my+apps&n=20&o=20 will (in theory) list the second page of results when searching for my List my Apps app and show 20 results per page.
  • I never paid attention to it before, but every search response contains a meta data container, listing the relevance of the results, the expected total number of entries (for the query) and the next page url. Stupid me! I always assumed, you had to do your own client side book keeping. I really need to rewrite the underlying library. It has numerous shortcomings and is not ageing well.
  • The next url in the meta data looks exactly like the one I am constructing manually (e.g. search?q=list+my+apps&n=20&o=20). But for some reason, the offset ( o= ) parameter gets ignored. In other words: I only get the first page of search results. But at least I can specify the page size. It’s an ugly workaround, though.
  • As of now, I have absolutely no idea why Play ignores the offset. So far I haven’t been able to spot any substantial difference between what Raccoon sends to the server and what a real device would.
  • Everyone who uses/advocated Hungarian Notation needs to be shot. Seriously! It’s one major distraction and makes debugging harder, not easier.
Posted in Android, Note to self