- MVVM
- Data Repository
- Usecases
- Hilt for dependency injection
- Singleton
- Observer (LiveData)
- StateFlow
- Shared preferences for user session data
- Room database for storing articles (offline mode)
- Data Binding - Declaratively bind observable data to UI elements.
- LiveData - Notify views when underlying database changes.
- Room - Fluent SQLite database access.
- ViewModel - Manage UI-related data in a lifecycle-conscious way.
- Navigation Component - Bottom navigation bar.
- Retrofit - A HTTP client for Android.
- Logging Interceptor - An OkHttp interceptor which logs HTTP request and response data.
- GSON - A serialization/deserialization library to convert Objects into JSON and back.
- Mockito - Mocking framework for unit tests.
First, clone the repo:
git clone https://github.com/batool-mofeed/Code-Challenge.git
Building the app then depends on your build tools.
(These instructions were tested with Android Studio version Eel)
- Navigate to the root directory of your project.
- Select the directory or drill in and select the file
build.gradlein the cloned repo. - Click 'OK' to open the the project in Android Studio.
- A Gradle sync should start, but you can force a sync and build the 'app' module as needed.
- Build the APK:
./gradlew build
Connect an Android device to your development machine.
- Select
Run -> Run 'app'(orDebug 'app') from the menu bar - Select the device you wish to run the app on and click 'OK'
Code Challenge The app consist of a splash, registration screen, dashboard and more in bottom navbar (for authenticated only). In addition, it support localization for English and Arabic.
• Handles navigation in the app (authenticated vs unauthenticated) • Handles navigation after changing language
• Form that takes ID – email – phone number – date of birth • Upon registering user details are stored and persisted • Make sure validation are implied to the fields and error are handled
• Register in NY times developer portal (https://developer.nytimes.com/docs/mostpopular- product/1/overview) • Use the most viewed service (https://api.nytimes.com/svc/mostpopular/v2/viewed/30.json?apikey=) • Show a section list of data • Section list is divided by date which will be in relative format (e.g. “1 day ago”) • Include a search bar that filter the result based on the title • Make sure to include a swipe down to refresh which reset the data
• Shows the stored user details • Logout button which clears the session and the user details The code challenge will be evaluated on the below: Code quality: Usage of patterns, Language skills, Project structure. Project support offline of the internet using room database to store articles.