This is an Android app built using Kotlin that showcases various features and libraries. The app allows users to explore the latest movies, get detailed information about them and watch their trailers. Users can also like their favourite movies and download their posters and wallpapers. The application also supports dark and light themes and multiple languages.
- Explore the Upcoming, Popular and Trends Movies β
- Get detailed description of the movies. β
- Get Related movies. β
- Like your favourite movies. β
- Get movies trailer within the application. β
- Download movie poster and wallpapers. β
- Download cast profile images. β
- Search for movies. β
- Support dark/light themes. β
- Support multiple languages. β
- Cache movies data to show when mobile go offline. β
- API Level 26+ β
- Kotlin: First class and official programming language for Android development.
- KTX: Kotlin extensions for Android, providing concise and idiomatic APIs.
- Coroutines: Asynchronous programming library for simplifying background operations.
- Flow: Reactive stream library for asynchronous and data-driven programming.
- Retrofit/OkHttp3: Networking libraries for making HTTP requests.
- Room: Persistence library for local database storage.
- Dagger-Hilt: Dependency injection library for Android.
- Navigation Component: Android Jetpack's library for navigating between screens.
- ViewModel-ktx: Part of the Android Architecture Components for managing UI-related data.
- WorkManager-KTX: Library for performing background work in a flexible and efficient way.
- Splash Screen: Library for creating splash screens on Android.
- Media3 ExoPlayer: Media playback library for Android.
- Sandwich: A lightweight and easy-to-use wrapper for Retrofit API calls.
- Coil: Image loading library for Android apps.
- Lottie: Animation library for Android.
- VeilLayout: Library for showing shimmering loading placeholders.
- PhotoView: Zoomable image view library for Android.
- SmoothBottomBar: Customizable and animated bottom navigation bar library.
- ShapeOfView: Library for creating various shapes for views in Android.
- SparkButton: Customizable and animated button library.
- SpringView: Pull-to-refresh and load-more library for Android.
- Security-Crypto: Library for encryption and decryption on Android.
- Kotlin YouTubeExtractor: Library for extracting YouTube video links.
- KenBurnsView: Customizable Ken Burns effect view library for Android.
- MotionLayout: Library for creating and managing motion and widget animation in Android.
- ViewBinding: Feature that allows you to more easily write code that interacts with views.
- Material Design Components: Library for implementing Material Design UI components.
com.memad.moviesmix # Root Package
app # Main Application Package
βββ data/ # For data handling.
β βββ local/ # Local Persistence Database. Room (SQLite) database
| β βββ MoviesDao.kt # Data Access Object for Room
| | |ββ Converters.kt # Type converters for Room
| β βββ FavouritesEntity.kt # Entity class for Room
| β βββ MoviesDB.kt # Database class that extends RoomDatabase
| β βββ MovieEntity.kt # Entity class for Room
β βββ remote/ # Remote Data Handlers
| β βββ MoviesClient.kt # Retrofit API for remote end point.
| β βββ StartClient.kt # Retrofit API for remote end point.
| di/ # Dependency Injection
| |ββ annotations/ # Custom annotations for DI
| | βββ FavouritesRepoAnn.kt # Custom annotation for Favourite repository
| | βββ PopularRepo.kt # Custom annotation for Popular repository
| | βββ TrendingRepo.kt # Custom annotation for Trending repository
| | βββ SessionKey.kt # Custom annotation for Session Key
| | βββ UpcomingRepo.kt # Custom annotation for Upcoming repository
β βββ ApiModule.kt # Provides Network dependencies.
β βββ DatabaseModule.kt # Provides Database dependencies.
β βββ ReposModule.kt # Provides Repositories dependencies.
β βββ UtilsModule.kt # Provides some other dependencies.
βββ models/ # Model classes
| |ββ AuthResponse.kt # Model class for Auth Response
| |ββ Cast.kt # Model class for Cast
| |ββ CastResponse.kt # Model class for Cast Response
| |ββ Movie.kt # Model class for Movie
| |ββ MovieResponse.kt # Model class for Movie Response
| βββ VideoResponse.kt # Model class for Video Trailer Response
βββ repos/ # Repositories
| |ββ DescriptionRepo.kt # Repository class for Movies Description
| |ββ FavouritesRepo.kt # Base repository class for Favourites
| |ββ FavoritesRepoImplentation.kt # Implementation of Favourites repository
| |ββ MainRepo.kt # Base repository class for all type of movies(Popular, Trending, Upcoming)
| |ββ mainRepoImpl.kt # Implementation of Main repository
| βββ SearchRepo.kt # Repository class for Search
βββ ui/ # Activity/View layer
β βββ main/ # Main Screen Activity & ViewModel (contains all components of the app)
| | βββ description/ # Description Screen Fragment & ViewModel & Adapters (contains all components of the movie description)
| | | βββ RecommendAdapter.kt # Adapter for Recommended RecyclerView
| | | βββ CastAdapter.kt # Adapter for Cast RecyclerView
| | | βββ MovieDescriptionFragment.kt # Fragment for Description Screen
| | | βββ DescriptionViewModel.kt # ViewModel for Description Screen
| | βββ favourites/ # Favourites Screen Fragment & ViewModel & Adapter (contains all components of the Favourites)
| | | βββ FavouritesAdapter.kt # Adapter for Favourites RecyclerView
| | | βββ FavouritesFragment.kt # Fragment for Favourites Screen
| | | βββ FavouritesViewModel.kt # ViewModel for Favourites Screen
| | βββ popular/ # Popular Screen Fragment & ViewModel & Adapter (contains all components of the Popular)
| | | βββ PopularAdapter.kt # Adapter for Popular RecyclerView
| | | βββ PopularFragment.kt # Fragment for Popular Screen
| | | βββ PopularViewModel.kt # ViewModel for Popular Screen
| | βββ search/ # Search Screen Fragment & ViewModel & Adapter (contains all components of the Search)
| | | βββ SearchAdapter.kt # Adapter for Search RecyclerView
| | | βββ SearchFragment.kt # Fragment for Search Screen
| | | βββ SearchViewModel.kt # ViewModel for Search Screen
| | βββ settings/ # Settings Screen Fragment
| | | βββ SettingsFragment.kt # Fragment for Settings Screen
| | βββ trending/ # Trending Screen Fragment & ViewModel & Adapter (contains all components of the Trending)
| | | βββ TrendingAdapter.kt # Adapter for Trending RecyclerView
| | | βββ TrendingFragment.kt # Fragment for Trending Screen
| | | βββ TrendingViewModel.kt # ViewModel for Trending Screen
| | βββ upcoming/ # Upcoming Screen Fragment & ViewModel & Adapter (contains all components of the Upcoming)
| | | βββ UpcomingAdapter.kt # Adapter for Upcoming RecyclerView
| | | βββ UpcomingFragment.kt # Fragment for Upcoming Screen
| | | βββ UpcomingViewModel.kt # ViewModel for Upcoming Screen
| | βββ viewer/ # Viewer Screen for shioing movie trailer / images
| | | βββ ViewerFragment.kt # Fragment for Viewer Screen
| | | βββ worker/ # Worker for downloading images
| | | βββ DownloadCompletedReceiver.kt # Broadcast Receiver for downloading images
| | | |ββ DownloadFile.kt # Class for downloading images
| | | βββ DownloadImageWorker.kt # WorkManager for downloading images
| | βββ MainActivity.kt # Main Activity
β βββ start/ # Start Screen Activity & ViewModel (contains all components of crating session and onboarding)
| βββ StartActivity.kt # Start Activity
| βββ start/ # Start Screen Fragment & ViewModel (contains all components of the Start)
| | βββ StartFragment.kt # Fragment for Start Screen
| | βββ StartViewModel.kt # ViewModel for Start Screen
| βββ onboarding/ # Onboarding Screen Fragment & Adapter (contains all components of the Onboarding)
| βββ OnboardingAdapter.kt # Adapter for Onboarding RecyclerView
| βββ OnboardingFragment.kt # Fragment for Onboarding Screen
βββ utils/ # Utility Classes / Kotlin extensions
β βββ AccessNative.kt # Native code for Accessing API key in the cpp file
β βββ CenterZoomLayoutManager.kt # Custom LayoutManager for RecyclerView
β βββ Constants.kt # Constants used throughout the app
| βββ DoubleClickListener.kt # Double click listener for views
β βββ Extensions.kt # Some Kotlin extension functions to help
β βββ GenresUtils.kt # Helper class for getting genres (as string) of movies
β βββ LocaleExt.kt # Extension function for getting/setting current locale
β βββ Mapper.kt # Mapper class for mapping data from MoviesResponse to MovieEntity
β βββ NetworkUtils.kt # Network Status as Reactive helper class
β βββ PermissionHelper.kt # Helper class for checking and requesting permissions
β βββ Resource.kt # A generic class that holds a value with its loading status.
β βββ SwipeToDelete.kt # Helper class for swipe to delete in RecyclerView
β βββ SharedPreferencesHelper.kt # Helper class for storing data in SharedPreferences
βββ App.kt # Application class
To securely store the API key used in the app, we utilize the Native Development Kit (NDK) to store the key in native code. This helps prevent the key from being easily extracted from the app's compiled code.
If you need to use an API key in the app, follow these steps:
- Obtain your API key from TMDB.
- Navigate to the
jni
directory in the project. - create a new file called
api_key.cpp
and add the following code:
#include <jni.h>
JNIEXPORT jstring;
jstring
Java_com_memad_moviesmix_utils_AccessNative_getApiKey(JNIEnv *env, jobject thiz) {
return (*env)-> NewStringUTF(env, "YOUR_API_KEY_HERE");
}
- Replace
YOUR_API_KEY_HERE
with your API key. - Build the project to generate the native library file that contains the API key.
This project is licensed under the [MIT License] License - see the LICENSE file for details.