thisAAY / taco

Android developer taco challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TACO ๐ŸŒฎ

[T]he [A]ndroid [C]hallenge :-[O]

Version 1.0

General Instructions

  • Fork this repository with your private GitHub account
  • After you are finished provide access to your fork for the user "sebastian-hoebarth"
  • Try to use libraries that are included in Android Jetpack before using any other 3rd party library
  • Try to support and use Material Design where ever possible
  • Use MVVM, Single Activity and other concepts where every you can...
  • The challenge is divided into separate parts, complete as many as you can
  • Please stop if you are hitting the 4 hour time frame!!
  • Good luck & enjoy your TACOs ๐ŸŒฎ

Pre-setup

The following structure and libraries are already provided. Please do not start a new project, use the current setup to continue in order to save time.

This project provides
  • An unfinished basic Android App implementation to start width
  • Dependency injection with Hilt
  • Database access with Room [FoodDb]
  • REST service client with Retrofit [TacoService]
  • List view item layouts
  • Basic navigation pattern
  • ViewModels & Databinding (if you are not familiar with any of those libraries, please check them out)
Links to Libraries you might find helpful
  • Foundation - Components for core system capabilities, Kotlin extensions and support for multidex and automated testing.
    • AppCompat - Degrade gracefully on older versions of Android.
    • Android KTX - Write more concise, idiomatic Kotlin code.
    • Test - An Android testing framework for unit and runtime UI tests.
  • Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
    • Data Binding - Declaratively bind observable data to UI elements.
    • Lifecycles - Create a UI that automatically responds to lifecycle events.
    • LiveData - Build data objects that notify views when the underlying database changes.
    • Navigation - Handle everything needed for in-app navigation.
    • Room - Access your app's SQLite database with in-app objects and compile-time checks.
    • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
    • WorkManager - Manage your Android background jobs.
  • UI - Details on why and how to use UI Components in your apps - together or separate
  • Third party and miscellaneous libraries

Your tasks

1. Project overview (Navigation & wire frames)

Use Jetpack Navigation to navigate between Fragments. Use ViewModel to hold the content. Store content in LiveData, access it in views with databinding.

Make yourself familiar with the project. It's a single activity-based architecture. Here is an example of how your final UI structure should look like:
GitHub Logo
You need to create all missing Fragments by yourself.

This is your starting point:
GitHub Logo
GitHub Logo
(use bottom bar navigation to switch between [CategoryListFragment] and [SearchFoodFragment])

2. Web request [CategoryListFragment]

Request and display all taco categories in a list. Show the list of categories in a two-column staggered RecyclerView. Use the remote repository with REST Api [TacoService]. Documentation can be found here: https://taco-food-api.herokuapp.com/#api-Category-GetCategoriesList Use "item_category.xml" layout as list item. (use databinding) Load the total amount of "Food" items referenced in a category and display that information in the item.

TODO:

  • Create list view
  • Create Adapter & ViewHolder
  • Load content from REST client
  • Async update item amount per category from the local database
3. Database [SearchFoodFragment]

Access the local database [FoodDb] provided in the App assets to load "food" information. Display all food elements in a single column list view. Use paging adapters, not load all search results at once into your list. Use "item_food.xml" layout as list item.

TODOs:

  • Create list view
  • Create Adapter & ViewHolder
  • Load paged content from database
5. Search [SearchFoodFragment]

Add a search box into the toolbar, filter local database [FoodDb] food results by the search term. Filter the search results based on "description" of a food item.

6. Food details [FoodFragment]

Selecting an item on SearchFoodFragment should lead to the detail screen of a food (FoodFragment). More details of a single food should be displayed on that screen, exactly like the UI/UX from Figma describes it UI components. (Font, Color, Shape, Size...) Load missing category name information from the web endpoint.

GitHub Logo

TODOs:

7. Add an image to a food [FoodFragment]

Let the user add an Image via an ImagePicker or Camera to a single food item. The image should be stored locally and displayed when the user shows the detailed food item.

TODOs:

  • Make sure to use ActivityResultContracts.
  • Use an image cache library to display a picture
8. Load category name on food detail screen [FoodFragment]

Request category name for this food item from web dynamically when it's shown on the detail screen. By clicking on the category the user can jump to the category detail page [CategoryFragment].

9. Category details [CategoryFragment]

Selecting a category in the [CategoryListFragment] or from [FoodFragment] opens the [CategoryFragment], showing all foods that are added to this category. Show the category name at the top, use navigation arguments to send information between fragments. Access the food database [FoodDb] and query all foods that have the selected category, again use paging. Display preview information of a food item. Might make sense to use the same

TODOs:

  • Create CategoryFragment
  • Setup navigation component and safe args
  • Prepare database query
  • Tip: reuse [SearchFoodFragment]

๐Ÿ Congratulation you finished the challenge ๐Ÿ

Some extra candy

If you are still hungry for more, choose one of the below bonus assignments for implementation. Happy coding!

๐Ÿญ Web requests

On mobile devices, the internet might fail due to connection issues. Prepare error indications when content can't be loaded from the web.

๐Ÿญ Edge to Edge

Work with display insets and create an edge to edge feel. Top and bottom bars should fade away when scrolling in a List view. Tip: use helper library from Chris https://github.com/chrisbanes/insetter

๐Ÿญ Create a custom theme

Introduce your custom design for font, colors, small medium and large components. Tip: checkout material design guidelines https://material.io/design/material-studies/fortnightly.html#shape

๐Ÿญ Memory leak

Finding memory leaks is a very important task when developing high-quality apps. Make sure there is no memory leak. I might have inserted one ;-) Tip: there is a nice library for detecting leaks https://square.github.io/leakcanary/

๐Ÿญ Performance

Developing apps for all kinds of devices is essential on Android and therefore performance optimization is crucial. Initialize all necessary libraries before Application.onCreate() is executed. Move your DB initialization into a content provider, checkout this helper library https://developer.android.com/topic/libraries/app-startup

๐Ÿญ Deep linking

Make a single taco category accessible via url (e.g: https://taco-food-api.herokuapp.com/api/v1/category/1)

๐Ÿญ Fragment transitions

Use Material motion transitions of your choice to transform between fragments. Take a look at material components API

Footnote

Make sure everything is pushed to your git repository. Please inform us when you have finished the challenge. We are not automatically notified.

Tip: don't forget about code documentation

Weโ€™d be happy to receive your feedback on the challenge. Let us know how you liked it.

About

Android developer taco challenge


Languages

Language:Kotlin 100.0%