All Projects → uziassantosferreira → Starwars-clean

uziassantosferreira / Starwars-clean

Licence: other
Simple project with clean architecture

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Starwars-clean

Star Wars Shop
Simple project with clean architecture and android lifecycle
Stars: ✭ 37 (+8.82%)
Mutual labels:  dagger, clean-architecture, mockito, junit
EasyUtAndroid
Android unit testing example 全面的android应用单元测试方法及案例
Stars: ✭ 21 (-38.24%)
Mutual labels:  mvp, mockito, junit
AndroidStarterAlt
A sample View-based Android app using the MVP architecture. It uses Mosby, Dagger2, RxJava, retrofit, LoganSquare, requery, EventBus, Conductor.
Stars: ✭ 27 (-20.59%)
Mutual labels:  mvp, mockito, mockwebserver
AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (+129.41%)
Mutual labels:  mvp, dagger, mockito
Android-Starter-Kit
This is up-to-date android studio project for native android application, that is using modern tools and libraries.
Stars: ✭ 16 (-52.94%)
Mutual labels:  mvp, clean-architecture, mockito
UTair-MVP-Sample
Android Clean Architecture + MVP Sample written in Kotlin
Stars: ✭ 27 (-20.59%)
Mutual labels:  mvp, dagger, clean-architecture
Android Mvp Architecture
🏛 A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.
Stars: ✭ 203 (+497.06%)
Mutual labels:  mvp, clean-architecture, mockito
Mvvm Kotlin Android Architecture
MVVM + Kotlin + Retrofit2 + Hilt + Coroutines + Kotlin Flow + mockK + Espresso + Junit5
Stars: ✭ 1,014 (+2882.35%)
Mutual labels:  mvp, mockito, junit
Androidut
Android开发中必要的一环---单元测试(Unit Test)
Stars: ✭ 419 (+1132.35%)
Mutual labels:  mvp, mockito, junit
Firebucket
Glimpse into Firebase, with a simple TODO list app built around Dagger, RxJava 2, Clean architecture and of course, Firebase.
Stars: ✭ 376 (+1005.88%)
Mutual labels:  mvp, dagger, clean-architecture
Android tmdb clean architecture
Showcase of clean architecture concepts along with Continuous Integration and Development for modular Android applications. Includes test suits (functional and unit tests) along with code coverage.
Stars: ✭ 63 (+85.29%)
Mutual labels:  mvp, clean-architecture, mockito
Marvel
Marvel Characters Android Application Assigned by smava GmbH
Stars: ✭ 227 (+567.65%)
Mutual labels:  mvp, dagger, mockito
to-string-verifier
To String Verifier provides an easy and convenient way to test the toString method on your class.
Stars: ✭ 25 (-26.47%)
Mutual labels:  test, junit
CI-Report-Converter
The tool converts different error reporting standards for deep compatibility with popular CI systems (TeamCity, IntelliJ IDEA, GitHub Actions, etc).
Stars: ✭ 17 (-50%)
Mutual labels:  test, junit
action-junit-report
Reports junit test results as GitHub Pull Request Check
Stars: ✭ 103 (+202.94%)
Mutual labels:  test, junit
kit-assignment-tests
Test collection for KIT programming assignments (WS16/17)
Stars: ✭ 18 (-47.06%)
Mutual labels:  test, junit
RSS-Reader
Simple project with clean architecture
Stars: ✭ 31 (-8.82%)
Mutual labels:  test, clean-architecture
osgi-test
Testing support for OSGi. Includes JUnit 4 and JUnit 5 support and AssertJ support.
Stars: ✭ 22 (-35.29%)
Mutual labels:  test, junit
Mimic
Seamless client side mocking
Stars: ✭ 380 (+1017.65%)
Mutual labels:  test, mocking-framework
Junitperf
⛵️Junit performance rely on junit5 and jdk8+.(java 性能测试框架)
Stars: ✭ 86 (+152.94%)
Mutual labels:  test, junit

Supported languages:

Summary

  1. Introduction
  2. Architecture
  3. Application Setup
  4. License

Introduction

Overview

Create an application capable to read urls from Star Wars API, displaying these information in an application of type master-details. The requirements raised for this assignment shall test concepts of:

  1. Architectural design for Android Applications;
  2. Ability to communicate with complex end-points, parsing JSON responses and update UI;
  3. Data persistence and database manipulation;
  4. Sensor manipulation (camera);
  5. Permission requirement lifecycle;
  6. other.
Requirements
ID Name Description
REQ001 Read QR Code Application must be able to read an URL from a QR Code image, storing the collected data locally
REQ002 Display people list Display to the person a list with all read people containing, at least, person’s name and URL
REQ003 Display user details When click on a list item, application must display person’s details including a list of movies that that character was part of. Among the details;
REQ004 Allow information caching All information once loaded from web into app must be persisted locally and accessible offline
REQ005 Allow URL typing to gather character information In order to enable emulator use and automation testing app must provide another way to collect character information that doesn't make use of the camera sensor
REQ006 Internationalize the application Add support for portuguese language

Showcase



QR Code Samples


Figure 01: sample qr codes generated on: http://br.qr-code-generator.com/

Individual images can be found here

Architecture

-----------------

Architectural approach

Architectural reactive approach

Design Patterns

  • Singleton: this pattern is used mainly to offer a single instance of presenters for their respective views. Its implementation happens thanks to Dagger2 @Singleton annotation;
  • Observer: this pattern is largely used in order to issue network events that trigger database actions or UI updates. The variant employed is observed based on bus, being all call routed to a class that holds reference to all subscribers;
  • Delegate: this pattern is used in more than one place in the Application, for instance, with Postman and Router classes. The idea is to decouple classes that play distinct roles in the app - as the ones responsible for network communication for instance. That way, if any maintenance is required on them it is not passed beyond the class that gather all calls;
  • Factory: the application uses Factory Pattern on default Dagger2 implementation as well as to acquire End Points references for instance;

Quality Assurance

One of the most importants gains that the MVP pattern brings to the project is the fact that all business logic gets isolated on Presenter Layer, it means, all code worthy to be tested is well encapsulated on classes with low dependency on OS components. This pattern alied with a Dependency Injection Container and Mock Frameworks (such as Mockito and PowerMockito) allows the developer to take full advantage of Unit Tests.

Despite the good coverage - over the classes that are worthy testing - it is always a good idea to include automation tests on the project. Currently, the offical adviced automation tool is Espresso that counts with a faboulous tool embbeded on Android Studio that lets the developer record automation steps while manipulation the app as an user. In order to develop this concept, the following story was created:

Test Scenarios
ID Description
S001 As an user I should be able to:
- start the application;
- click on left corner menu to manually insert a character's URL;
- Type the URL and hit okay;
- See that the application has loaded the information correponding the typed URL on the screen;
- Check that the name is correct;



Figure 02: sample automation test generated using Espresso

Frameworks

  • Requery to database: “(...) A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perform queries and updates from any platform that uses Java.”
  • Retrofit: _"(...) A type-safe HTTP client for Android and Java;
    • OkHttp: “(...) HTTP is the way modern applications network. It’s how we exchange data & media. Doing HTTP efficiently makes your stuff load faster and saves bandwidth. OkHttp is an HTTP client that’s efficient by default:

      • HTTP/2 support allows all requests to the same host to share a socket.
      • Connection pooling reduces request latency (if HTTP/2 isn’t available).
      • Transparent GZIP shrinks download sizes.
      • Response caching avoids the network completely for repeat requests.

      OkHttp perseveres when the network is troublesome: it will silently recover from common connection problems. If your service has multiple IP addresses OkHttp will attempt alternate addresses if the first connect fails. This is necessary for IPv4+IPv6 and for services hosted in redundant data centers. OkHttp initiates new connections with modern TLS features (SNI, ALPN), and falls back to TLS 1.0 if the handshake fails. Using OkHttp is easy. Its request/response API is designed with fluent builders and immutability. It supports both synchronous blocking calls and async calls with callbacks. OkHttp supports Android 2.3 and above. For Java, the minimum requirement is 1.7…”_

    • Gson: “(...) A Java serialization/deserialization library that can convert Java Objects into JSON and back…”

    • RxAndroid: “(...) ReactiveX is a combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming...”

  • Dagger 2: a dependency Injector for Android and Java, used to grant one of the S.O.L.I.D. principles for OO programming (Dependency Inversion Principle). Besides allowing the high level class to not depend upon low level ones, it makes Unit Test easier to perform with the help of a mocking framework i.e. Mockito;
  • Other:
    • MaterialBarcodeScanner: "(...) Easy to use barcode reader for your Android Project (Uses Google Mobile Vision API)..."

End points

  • Star Wars API: “(...) The Star Wars API, or "swapi" (Swah-pee) is the world's first quanitified and programmatically-accessible data source for all the data from the Star Wars canon universe! We've taken all the rich contextual stuff from the universe and formatted into something easier to consume with software. Then we went and stuck an API on the front so you can access it all!...”

Application Setup

In order to make this application work, follow the steps below:

  1. Have a Android Studio 3.0
  2. Clone the repository to your local machine;
  3. Build the project.

License

Copyright 2017 Uzias Santos Ferreira

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].