TheMovieDb API – Part 8 – Show me more info!

Quickly open android studio! Welcome back to this series on implementing TheMovieDb API. As always remember all the code for this series will be in this GitHub repo today we are setting base to show off movie details!

Let’s begin! First since we are doing test driven development we want to keep our implementation separate, in other words, business logic outside of the UI. Create a MovieDetailsContract interface with the following:

public interface MovieDetailsContract {

    interface View {

        void setMoviePoster(String moviePoster);

        void setMovieBackdropImage(String backdropImage);

        void setTitle(String title);

        void setOverview(String overview);

        void setPopularity(Double popularity);

        void setReleaseDate(String releaseDate);

    interface UserActionsListener {
        void showMovieDetails();

Continue reading “TheMovieDb API – Part 8 – Show me more info!”

TheMovieDb API – Part 6 – The Movies Adapter

Hey! welcome back to this series on implementing TheMovieDb API. As always remember all the code for this series will be in this GitHub repo today we are jumping straight to Java once more, last week post was all about the design of the Movie view today we are building the bridge that connects it all, the movies adapter.

Let’s go! First keep in mind this is 2016 and beyond we need to re-use our views and who better than the RecyclerView for that job? We are going to create something called a ‘ViewHolder’ which it’s only job is to hold a reference of the views within our movie_view.xml and give it to the RecyclerView each time a new Movie object is given to him and reuse it. This view holder should also implement an interface to handle clicks on our actions buttons, remember RecyclerView is a decoupled version of ListView meaning all of these does not come out of the box. Tricky right? Let’s see how this looks in action:

Let’s create our interface responsible for the action clicks, I called it MovieItemClickListener:

First the movie viewholder, mine I called it MovieSingleRowViewHolder:

public interface MovieItemClickListener {
    void onMovieActionClick(View v, int position);

Continue reading “TheMovieDb API – Part 6 – The Movies Adapter”

This blog and why now

Hey there,

So it’s 2016 and Android is over 8 years old now since its first release 1.0. One can say that many APIs (Application Package Interfaces) have come and go in it and even that lots of blogs have arisen with the basics on this exciting and dominating mobile platform.

Android currently stands, in my opinion, mature where we don’t need guides about the basics, rather how to implement the more advanced stuff, this being Fused Location API, Advance Content Providers, Continuous Integration, Unit Testing and all that that implies and more.

Hopefully though the days to come you fill find such guide within this blog and bookmark/share with your friends and colleagues.  The content here will be very varied from Intents all the way to Location APIs and even encryption to continuous integration tools like Jenkins.

From now on you can expect daily content from Monday through Friday that will help you build your next android application and go beyond the limits with it.

Happy Coding,