Code Monkey home page Code Monkey logo

sgmobiledata's Introduction

SgMobileData with Android Architecture Components

Introduction

Scope

List of yearly record of Mobile data consumption in Singapore and highlighting the year in which there has been a decrease in the consumption between the quarters. Written in Kotlin, this app supports caching and works on Architectural Components from Android.

Functionality

The app is composed of one screen.

ResultFragment

Allows you to browse through the yearly records of Mobile data consumption in Singapore. Each result from API call is kept in the database in Result table. The API results are cached in the Room database, hence the subsequent request calls to the API are served from Room database.

NOTE The UI currently loads all Results items at once, which would not perform well on lower end devices. But since the list, by virtue of the type of its content, will not grow exponentially hence one-time load should work for this problem.

Building

You can open the project in Android studio and press run.

Testing

The project uses both instrumentation tests that run on the device and local unit tests that run on your computer. To run both of them and generate a coverage report, you can run:

./gradlew fullCoverageReport (requires a connected device or an emulator)

Device Tests

UI Tests

The projects uses Espresso for UI testing. Since each fragment is limited to a ViewModel, each test mocks related ViewModel to run the tests.

Database Tests

The project creates an in memory database for each database test but still runs them on the device.

Local Unit Tests

ViewModel Tests

Each ViewModel is tested using local unit tests with mock Repository implementations.

Repository Tests

Each Repository is tested using local unit tests with mock web service and mock database.

Webservice Tests

The project uses MockWebServer project to test REST api interactions.

Libraries

Limitations

  • Instrumentation test are not running.

sgmobiledata's People

Contributors

harshvardhan 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.