Git Product home page Git Product logo

login-assignment's Introduction

Login assignment

This repository contains a basic Android app that only does one use case: a user needs a screen to log in, introducing her username and password, with a fake API which returns a token. This token is stored in the local device so the app knows if the user is logged in. In that case, the app will show the main screen that only has a button to log out. Clicking this log out button removes the token and shows the login screen.

What the app offers

Based on the use case requirements, the app consists in:

  • A login screen, with a user and a password text fields, and a log in button.
  • A main screen, that only has one button to log out.
  • Functionality to call to login service that only returns a token, no validation nor real log in.
  • Capability to persist the token locally, so the user does not have to log in every time it enters the app.

Main points and decisions

There are a million ways to implement the use case as an app, but these are the main decisions taken within this project:

  • Use Kotlin as language to make use of a more modern programming language than Java.
  • Use AndroidX instead of support library because it's now recommended and has more future support.
  • Use Hilt as the dependency injection library to avoid using constructors and to make it easier to replace the real implementations in the tests, although, because they are so basic, the tests use the same classes as the app.
  • Structure the code with a Model-View-Presenter approach, to separate business logic from presentation.
  • Set up CI tooling, through GitHub Actions, to test and build a debug apk to show how these tools can help with automating these tasks before merging any pull request in the master branch.

Try it

Just go to Releases and download the latest debug APK in your Android device, or clone the repo and open the project with Android Studio to run it. There is no signed APK for simplicity reasons

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.