Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJeffrey Kwok
551 PointsA question about Java, Android Development, and database
Let's say I wanted to make a "movie" android app. My hypothetical app aggregates movie reviews from rottentomatoes.com and imdb.com. My question is how does one go about obtaining all the data from rottentomatoes and imdb when I'm coding my app? is there a special code that allows me to access data from these two websites? Do I have to pay rottentomatoes or imdb? Is this even remotely possible? I'm completely new to app development. Forgive me naivety lol
1 Answer
Seth Kroger
56,413 PointsBoth those websites very likely have APIs you can use to retrieve data from them. These APIs (Application Programming Interface) provide an interface you can use to access the site's data in various ways through website requests. With the APIs you could access the data as you need to from the app by querying the site without having to store all the data in a database yourself. If you look at the sites' homepage near the bottom, there's usually a link that says "API" or "Developers" that will show you the info you need, and what they require.
Jeffrey Kwok
551 PointsJeffrey Kwok
551 Pointsthanks!
Jeffrey Kwok
551 PointsJeffrey Kwok
551 PointsI have a followup question. I researched through a few APIs i was interested in and alot of them are in XML and JSON. Is it possible to convert XML/JSON or any other language into java?
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsXML and JSON aren't programming languages per se, They're data formats. But there are a number of Java tool kits to read and write XML and JSON, including some built into the Android OS. The Android Track here covers using the built-in JSON library to read data from an API. Others a bit more sophisticated can translate them back and forth from Java objects automatically like Gson and Jackson.
Jeffrey Kwok
551 PointsJeffrey Kwok
551 Pointsthanks again!