Basically, there are two types of search in this app: Movie and Person.
The flowchart on how movie searching app works is shown in the figure below.
There are two additional features that I have added in the android applications: Progress Bar and Online Searching function. The Progress Bar is the indication of the progress of retrieving the JSON data from the URL. The online searching function includes retrieve the data from the URL and convert the JSON format to JAVA Object using GSON library. There were problems I have encountered in the process of completing the task as shown below.
1)Problem: API of movie database was upgraded to version 3, therefore, all the data is presented in JSON format instead of XML format
Solution: Use the GSON libray to convert JSON format into Data Object and display relevant data in the form of pop-up message at the bottom of the app.
2)Problem: Method to acquire the data from the movie database
Solution: Acquire API key of the movie database. Construct the URL with API key in order to obtain JSON data.
3)Problem: NetworkOnMainThread Exception occur while retrieving data from database
Solution: Async task was used to solve the “NetworkOnMainThread” exception error.
The operation of app is explained and the result of the movie searching app is shown as follows:
First of all, with movie-search type, the text “inception” was entered as shown in the figure below. The progress bar is shown while obtaining the data from the url after user clicks on the “Search Button”.
After data is obtained, the movie title and popularity are shown in the pop-up message.
For person-search type, the operation is same as the movie-search type as shown in the figures below.
In the next blog, I will discuss about detail description of structure of coding and ways to troubleshoot the bug of the app.