• This repository has been archived on 19/Jan/2021
  • Stars
    star
    181
  • Rank 212,110 (Top 5 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android Engineer Challenge for Guidebook.

Important! This version of the README is depreciated. I added support for Dagger Dependency Injection and redid the package structure with the goal of leaving the cleaner design. These changes are being made based on suggestions, tips and advice received in this Reddit question. I'll be updating this README as fast as possible to keep true to the code. Thank you!

You can download the APK here. To go to the original challenge, click here or here. It was developed to serve as an example of RxJava, MVP and Clean Architecture.

Important! The code was developed in an hour. But I took (much) more time writing the README.

Description

Create an Android application that displays information received over the network.

  1. Retrieve and print out the data received from the url above.
  2. Parse the data retrieved from the server into a list of Java objects
  3. Display your objects in an organized fashion (ListView, GridView, etc.)
  • Should display the name, city, state, and end date
  1. In addition the object’s name, have your view display the image located at each object’s icon url.

Implementation Details

To maintain the quality of good code, I decided to use an architecture based on the MVP pattern and inspired by the Clean / Hexagonal Architecture.

Basically I created three main packages: Core, Data and Ui.

Clean / Hexagonal Architecture

  • Core: Keep the domain rules (which in this case are none), models and aggregations models.
  • Data: Responsible for any data used in the application. Uses the Repository pattern.
  • Ui (View + Presenter): Responsible views. It is also responsible for the presentation (Presenter).

Obs: Where is the Interactors in Core Layer? I did not think it was necessary. I wanted to show my skills, but still want to keep as simple as possible.

Repository Pattern

Allow change data from the internet and database without breaking the abstraction defined by the interface. Thus the code that uses the repository does not need to care about the place that the data is coming.

Repository Pattern

Model View Presenter

With the separation between View and Presenter, we create a isolated place for Unit Test and single responsibility layers. The Presenter allow unit test without the discomfort of mock Android SDK.

Model View Presenter

UX / UI

I tried to follow the Material Design pattern in available time. Did you like it?

Guide List

Libraries

  1. RxJava + RxAndroid: This is the best way to work asynchronously and maintain the application scalable. I'm not a genius with Rx, but I really love it.
  2. Retrofit + OkHttp: For Network Request and Rx integration.
  3. Picasso: For image loading.
  4. ButterKnife: For view binding.
  5. PaperDb: For easy caching (database).
  6. Gson: Retrofit integration for deserialize.

Infraestruture Details

The server at the following url responds with JSON formatted data:

(GET) http://private-c60ade-guidebook1.apiary-mock.com/upcomingGuides

The response represents a list of “Guide” objects:

{
  "data": [
  {
    "startDate": "<date>",
    "endDate": "<date>",
    "name": "<name>",
    "url": "<url>",
    "venue": {"city": "<city>", "state": "<state>"},
    "icon": "<url to png image>"
    },
    … <more objects>
    ]
  }

Contributors

Although it was developed at a time to serve as a simple example, if you think you can improve it do not be shy to make your Fork / Pull Request. I will love analyzing improvements to this code.

More Repositories

1

retained

[ACTIVE] A lightweight alternative to Android's ViewModels. The easiest way to retain instances in Activities, Fragments or Composables.
Kotlin
323
star
2

hilt-to-anvil

Sample Dagger setup using Anvil to simulate Hilt features.
Kotlin
39
star
3

kotlin-fixture

[Deprecated] Fixture is an open source library designed to make it easier to create object graphs containing test data.
Kotlin
26
star
4

android-blanket

[Deprecated] Blanket is a ​simple library to help you bind your views and use a fluent interface to ​access their methods. No boilerplate code, I ​promise.
Java
12
star
5

android-challenge-mobicare

Android Engineer Challenge for Mobicare.
Java
11
star
6

android-simple-settings

[Deprecated] Easy and fast server configuration manager.
Java
10
star
7

staccato

A lightweight state management library for Compose.
Kotlin
5
star
8

android-challenge-goconqr

Android Engineer Challenge for GoConqr.
Java
5
star
9

android-condufacil

Java
4
star
10

android-challenge-concrete

Android Engineer Challenge for Concrete.
Java
2
star
11

android-challenge-belly

Android Engineer Challenge for Belly.
CMake
2
star
12

csharp-rest-builder

[Deprecated] Classe simples para utilizar o padrão Builder na lib RestSharp (https://github.com/restsharp/RestSharp).
C#
2
star
13

anvil-missing-modules

Kotlin
1
star
14

marcellogalhardo.github.io

HTML
1
star
15

android-challenge-quandoo

Android Engineer Challenge for Quandoo.
Java
1
star
16

android-gecko

Java
1
star
17

bur-report-dexter-black-screen

Repository create to report a Bug on Dexter Library.
Java
1
star
18

kotlin-gilded-rosa-kata

Starting code for the GildedRose Refactoring Kata in Kotlin.
Kotlin
1
star
19

android-lynx

Java
1
star