0

i am a newbie android coder. i am writing a practicing app to search Movie name. I have made XML and java which has a textbox for user to type movies name, but i don't know how to search this over internet! as i know i have to use IMDb or TMDb API, but i have no idea how to use it! i found this site :

http://www.javacodegeeks.com/2010/10/android-full-app-part-2-using-http-api.html

but there is no explanation for codes. and also i didn't found any other learning. can somebody please write a full explanation for how to use IMDb or TMDb API for newbie? it would be a great help to new coders like me! :)

1 Answer 1

1

you are most likely going to interact with these api using HttpClient. Go thru those examples first, like pulling in twitter feeds etc. Then you will be ready for the specifics of IMDb. So you are going to have to

1) Determine the base request url. Maybe it is imdb.com/api (it will be in the documentation).

2) you might need to sign up for a key which you will pass over as a parameter. (also in the documentation)

3) read the documentation to determine if you are going to use get/post since it effects how you encode the parameters. One of those parameters might be the key or you might not need a key.

4) In general you should try first in browser client before writing code, just to see what is returned. Then do the same in your code before processing.

5) all http clients are much the same, but determine what you are getting back. Is is JSON, use simple_json to parse. Is it XML, then probably use a SAXParser to handle what is returned. If you have specific questions please post them. The best we can do is give you sort of an algorithm like this as to how you go about it.

Thats really all there is to it. Just make sure you know the right url, if there is a key, if the communication is via get or post, if they are using REST you will encode url without parameters usually. Then its just a matter of parsing what you get back.

The real answer is take it one step at a time. At each step, ask if you have questions. The truth is unless we have used a particular protocol no one knows up front. Trust me, just take it one step at a time, and you will be able to handle any http api.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.