Giter Site home page Giter Site logo

nishkarsh / people-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 326 KB

This is a sample android application with a purpose of demonstrating a sample profile page that is editable using the latest and popular android technologies at the time.

Kotlin 100.00%

people-app's Introduction

people-app Build Status

This is a sample android application with a purpose of demonstrating a sample profile page that is editable.

Building the Project

You would need an android emulator to test this application. The DEV build variant points to 10.0.2.2 which would point to the localhost where ProfileService should be running.

  • Build: ./gradlew build
  • Unit Test: ./gradlew test
  • Android Instrumentation Test: ./gradlew connectedQADebugAndroidTest [Emulator needs to be up]

Please make sure to use QA build variant while running instrumentation tests if run from Android Studio. The URLs in QA product flavour points to a stub MockWebServer.

Please also make sure that the animations are disabled on the emulator while running the tests

Note: This app needs Profile Service to be up and running on local. When this service is up, it listens for connections on port 9740.

Functionalities

  • First time user lands on the EditProfileFragment in Create mode.
  • Profile picture could be selected along with entry of information in other fields. (Tested with jpg files)
  • The dynamic storage permission is handled for selecting picture.
  • The validation for required fields is handled. It kicks in when the user taps on Create/Save profile. The state is cleared on changing the values.
  • The information is retained across orientation change.
  • When user taps on Create/Save, the POST /profile call is made and a profile is created on the server. The profile ID is returned and kept in SharedPreferences.
  • The user is taken to ProfileFragment that displays the details and a Edit Floating Action Button.
  • On clicking of Floating Action Button, the EditProfileFragment opens up in Edit mode.
  • The snackbar displays the status, whether loading or an error.
  • Display of Snackbar with retry when the network calls fail to fetch the profile.

All these functionalities have been tested on Android emulator running API 29 - Pixel 3a

Technologies Used / Configuration

  • Min SDK version: 21
  • Target SDK version: 29
  • Proguard is not enabled
  • Testing: Junit 5 with Mockito for Unit and Espresso for UI testing
  • Language & Components : Kotlin with Coroutines
  • Patterns: View Models, Data Binding, Dagger 2 for DI, Butterknife for View Injection
  • Networking: Retrofit with OkHttp

Note: The app also has a dependency on com.intentfilter:android-permissions:2.0.49 which is an open source library written by me. This library helps in easily dealing with dynamic permissions.

Things kept in consideration

  • Theme colors match SN brand colors.
  • Handled configuration change (use ViewModel)
  • Used retrofit with kotlin coroutines and lifecycle extension
  • Number of Unit Tests: 40
  • Number of UI Test: 1 (Checks the most important Create Flow)

Known Issues / Scope for Improvements

  • The state when network calls fail is not handled very appropriately. The FAB and the Create/Save button is not disabled when the network calls fail.
  • The loading state could be handled better with an in place loader.
  • The location autocomplete is not validated for the input value other than the possible choice from within the list. If an invalid value is kept, the generic error shows up when user attempts to create/edit profile.
  • The code could be refactored at places. If I have to, the first thing that I would do is split the ProfileViewModel into two.
  • The configuration change retains the values for all the fields except for when the SingleAttributeChooserFragment is open and then the screen is rotated. There is a possiblity to handle this scenario, right now it was compromised because of the possiblity to reuse code.

Lastly, the focus has been paid on both Android and Server Side. Logic on both the platforms has been tested to a good extent along with other best practices recommended by different sources.

people-app's People

Contributors

nishkarsh avatar

Watchers

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