GithubHelp home page GithubHelp logo

android-agri's Introduction

Apollo Agriculture Android Take Home Assignment

Requirements

  • Add a second screen to the app with weather data for the current location. Use the following initial wireframe we've made:

  • The output from our weather API looks like this:

{
 "today": {
   "lowTemp": 23.36,
   "highTemp": 24.66,
   "icon": "CLEAR_DAY",
   "description": "clear sky"
 },
 "tomorrow": {
   "lowTemp": 23.63,
   "highTemp": 24.9,
   "icon": "SCATTERED_CLOUDS_DAY",
   "description": "scattered clouds"
 },
 "dayAfterTomorrow": {
   "lowTemp": 22.73,
   "highTemp": 25.14,
   "icon": "BROKEN_OVERCAST_CLOUDS_DAY",
   "description": "broken clouds"
 }
}

Feel free to use however you think best in the app, it's also available at https://apollo-web-public.s3.eu-west-1.amazonaws.com/eng/android-takehomeassignment/weather.json so feel free to add an API client.

  • Documentation for the API is available in API.md in this folder.
  • Use any libraries for Android that you want, but we will need to be able to build your code to evaluate it.

Architecture

Layers

1. Domain

This is the core layer of the application. The domain layer is independent of any other layers thus the domain models and business logic can be independent from other layers.This means that changes in other layers will have no effect on domain layer eg. screen UI (presentation layer) or changing database (data layer) will not result in any code change withing domain layer.

Components of domain layer include:

  • Models: Defines the core structure of the data that will be used within the application.

  • Repositories: Interfaces used by the use cases. Implemented in the data layer.

2. Data

The data layer is responsible for selecting the proper data source for the domain layer. It contains the implementations of the repositories declared in the domain layer.

Components of data layer include:

  • Models

    -Dto Models: Defines POJO of network responses.

  • Repositories: Responsible for exposing data to the domain layer.

  • Mappers: They perform data transformation between domain, dto and entity models.

  • Network: This is responsible for performing network operations eg. defining API endpoints using Ktor.

  • Cache: This is responsible for performing caching operations using Room.

  • Data Source: Responsible for deciding which data source (network or cache) will be used when fetching data.

3. Presentation

The presentation layer contains UI components.

Tech Stack

This project uses many of the popular libraries, plugins and tools of the android ecosystem.

Libraries

  • Koin - Dependency Injection library.
  • Jetpack Compose
    • Modern toolkit for building native UI.
  • Ktor - Provides multiplatform libraries required to make network calls to the REST API.
  • kotlinx.serialization - Provides sets of libraries for various serialization formats eg. JSON, protocol buffers, CBOR etc.
  • Coroutines - Library Support for coroutines.
  • ViewModel - Designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations.
  • Navigation ComponentComponent that allows easier implementation of navigation from simple button clicks to more complex patterns.
  • Timber - Library for easier logging.
  • Material Design - Build awesome beautiful UIs.
  • SplashScreen API - Loading application splashscreen.
  • Firebase Analytics - A real time analytics tracking tool.
  • Firebase Crashlytics - A real time crash reporting tool.
  • Firebase App Distribution - Distribute debug app to testers/QA before release.

Test Libraries

  • Junit4
    • Test framework which uses annotations to identify methods that specify a test.
  • Robolectric - Framework used to quickly and reliably run unit tests quick using the JVM.
  • Espresso
  • Truth - Assertions Library,provides readability as far as assertions are concerned.
  • Mockk - Mocking framework for tests.
  • Ktor Client Mock - Simulates HTTP calls for unit and integration tests without connecting to the endpoint.

Gradle Plugins

  • KtLint - Creates convenient tasks in your gradle project that run kotlin lint checks or do code auto format.
  • Detekt- A static code analysis tool for the Kotlin programming language.

CI/CD

  • GitHub Actions - GitHub actions is used in this project to check for syntax correctness using linting, execute the unit tests, generate a new package and deploying the debug apk using Firebase App Distribution when pushing changes to the dev branch or when making a pull request to the main branch.

Screenshots

These are the app's screenshots:

android-agri's People

Contributors

victorkabata avatar joel-apollo avatar joelhaasnoot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.