Readme

App

Brief description of the app architecture

The application has a simple MVVM architecture based on a single Activity coupled with his own ViewModel.
For the sake of simplicity no fragments and DI were used.

How to run it

  1. Clone the Repository
  2. Open it on Android Studio
  3. Build and Run

SDK

Dependecies used

  • Room: to save list of pokemon offline to avoid multiple REST call to pokeapi
  • Retrofit: to make HTTP calls to pokeapi and translatefun services
  • Moshi: to map Json to Data classes
  • Coil: to load image from url and use the integrated cache
  • Roboelectric: to test basic functions of the SDK

How to integrate the SDK into an existing project

Services

1 . Create an instance of Pokemoogle

val pokemoogle = Pokemoogle(applicationContext)

Remember the SDK provide only suspend function!

2 . Get the Pokemon Image

val imageUrl =  pokemoogle.getPokemonSprite(pokemonName)

3 . Get the Pokemon Shakesperean Description

val shakespeareanDesc =  pokemoogle.getShakespeareanDescription(pokemonName)

CustomView

The SDK provide a custom view of type PokemonView that display an image and a description. Steps to integrate it:

1 . Include your custom view inside your layout.xml

    <com.appersiano.pokemooglesdk.uicomponents.PokemonView
        android:id="@+id/pokemon_view"
    />

2 . Set a description

	val description = "This is a description"
    findViewById<PokemonView>(R.id.pokemon_view).setDescription(description)

3 . Set an image

    val imageUrl = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/6.png"
    findViewById<PokemonView>(R.id.pokemon_view)w.setImage(imageUrl)

Brief description of the SDK architecture

The SDK provide only on point of access: the Pokemoogle class that is not declared as a singleton to let the user free to do it with his DI tool.
The pattern used for the SDK is a Repository pattern.

SDK Architecture

GitHub

View Github