GithubHelp home page GithubHelp logo

police-cases's Introduction

Police Cases

Police Cases UK

This project contains an app that, using Kotlin and the latest Android Studio (AS), demos how to load data from [https://data.police.uk/docs/] and show it to the user.

Notes:

  • This project is by far production ready
  • It uses coroutines to communicate between the different parts of the app.
  • It has a feature module, but it's not attached to an instant app module, but should be ready to adapt.

Screen flow

A persistent state machine for each screen is used to handle the control flow of each screen

Each Screen object (Activities) has two main channels. One, outwards, which provides events to the state machine. And the other one, inwards, consumes states sent by other parts.

These channels are Kotlin coroutines' Channels. They provide a simple, yet powerful pub/sub pattern. They suspend a thread until a value is either sent (send) or offered (offer). The later doesn't suspend the thread at the side of the emitter.

Dependency Injection

In this instance, instead of using the customary Dagger 2, I've used manual injection benefiting from some of the features that Kotlin gives us, like property delegation.

What's missing:

  • More caching. The app does no caching other than in memory; this can be improved in several ways. Ideally, the server should provide eTags or expiration dates, and on OkHttp we can set an Interceptor.
  • For this time, I have merged the view components (Activities) with the state machines. However, they should be moved to a plain Kotlin module along with the model objects. However, there are a couple of issues running unit tests with tests in AS 3.0 and standard Kotlin modules.
  • More testing. I've done a couple of showcases. However, due to time limits, it's not fully tested yet.
  • Separate details screen. To keep it simple, I've made the list that shows crimes use expandable rows. However, this was a shortcut. Ideally, it should show a separate screen, maybe on a live map.

police-cases's People

Contributors

pablisco avatar

Watchers

James Cloos avatar  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.