Discussion Android

Has anyone successfully got a response from the API with Android - preferably using the Volley library - who would like to share enough code to get me connected, please?
I can sort of connect but it's complaining I have an invalid or incorrect Content-Length, or returning an error if I forcibly set the one it asks for!
I've got plenty of info to work with if I can at least get it to successfully connect and I do learn best by trial and error, but this has me stumped.
 
Thanks Bam.
I've had a look, and that's useful for a lot of what I want, but I do want to try and get Android to talk to the companion api - I don't know if it (the api) does what I want it to, but I can only find out by connecting and seeing what data comes back!
 
The Companion API was originally supplied exclusively for the iOS "Companion" app. So you need to fake up an iOS-like User-Agent string in order for it to give you useful info.

I'm not familiar with Volley, but I understand that you do this by overriding the getHeaders() method. See this example.
 
Last edited:
That could be it - thanks. It's certainly what I was trying to do, but not the way I'd been shown how to do it so ... fingers crossed!
 
Back
Top Bottom