Code Monkey home page Code Monkey logo

mobilespotter's Introduction

mobilespotter

App to detect current user of mobile device that is rented. Technologies: Kotlin coroutines, LiveData, ViewModel, Hilt, Jetpack Navigation, etc.

Structure

View

View layer is implemented in single activity style (MainActivity) that has a fragment view container The fragments that are inserted into container implement BaseFragment interface, which contains:

  1. onSetupLayout() - for layout operations
  2. onBindViewModel() - for LiveData and other bindings with VM
  3. observeOperations() - for observing live events from VM - initialized once the fragment is created (otherwise caused bug with multiple observe of one event)
  4. onCodeRecognized(code: String) - for futher operations with recognized rfid code. Each fragment has its own implementation of this method
  5. showFloatingActionButton: Boolean - for show/hide fab with rfid dialog

ViewModel

Is implemented in BaseViewModel interface that has no methods. Logic is here

Domain

Domain layer is implemented in UseCases each of them contain only one remote method. There are two types of UseCases: simple UseCase (that receives no params from user) and UseCaseWithRequestedParams (waits for params from user)

Remote

Remote layer contains two sources of information: Preferences and Retrofit service Preferences is implemented in single file PreferencesStorage.kt and has simple SharedPreferences implementation Retrofit service contains factory (ApiServiceFactory.kt) implementation and ApiService.kt interface that contains all the methods


TODO

  1. Implement multiple operations in one observe method

mobilespotter's People

Contributors

alekseykislyakov avatar

Watchers

 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.