Creating a Movie search App with Xamarin.Forms and Prism
I just created the Movie DX app, a weekend project made in Xamarin.Forms using Prism, in order to get started, practice and show the performance of this framework and the new changes in Xamarin.Forms.
For this project I used a few components/libraries:
- TheMovieDB API, to get Movies info.
- Prism for Xamarin.Forms, a very cool framework with great features that allows you to create apps easily.
- Corcav.Behaviors, I found this library very useful to handle commands.
- SQLite.Net-PCL, to store user and movies info locally.
- FFImageLoading, a very amazing library to load images quickly, very customizable to improve memory consumption, some effects, etc.
The Application is divided in 5 projects,
- MovieDX.Core, this project contains all the logic and implementation to connect to TheMovieDB API, in order to get all the movies information.
- MovieDX.Forms, this project contains all the Data Access implementation where I’m using a Generic Repository to handle the user and movies data.
As you know this projec also contains all the User Interface (made in XAML), here I’m using the Prism framework which I found very useful and easy to learn, the only thing I found a little bit tricky was Commanding, for that reason I added another library Cocav.Behaviors to handle that part. I wanted to use a ListView - custom ViewCell - Data Template Selector and bind their commands, because I wanted to re use that ViewCell in severall pages but I had an Issue (If someone find a fix it will be appreciated since right now the ViewCell is hardcoded in each ListView - not cool).
- MovieDX.Droid, Contains the basic info for an Android project.
- MovieDX.iOS, Contains the basic info for an iOS project.
- MovieDX.Tests, I just set up a Unit test project, it only contains one full Unit test to one of the View Models in the MovieDX.Forms project, I’m using NUnit and Moq.
The Application has a very simple authentication, User registration and log in, and the main functionality is to allow the user to see the some movie lists, also to search movies by name, see details, add movies to Watchlist, seen and custom lists. (there are some obvious validations not included for simplicity).