Skip to content

List-Detail view for Android utilizing the JokeAPI to display the joke setup in a list, and the joke details in the detail view.

License

Notifications You must be signed in to change notification settings

kevinmhankes/JokeAPI-Android

Repository files navigation

JokeAPI-Android

This is an app using Android Architecture Components with Koin as a replacement for Dagger Hilt dependency injection.

NOTE: I have filtered the joke results to not return any jokes that are nsfw, religious, political, racist, sexist, or explicit. The jokes should be appropriate, but there is a chance something slipped through the API's filters.

Introduction

Functionality

The app is composed of 2 main screens

JokeListFragment

Displays 10 jokes from the JokeAPI in a scrollable list. Each joke in the list displays a joke setup and is clickable, which navigates to the joke detail view.

JokeDetailFragment

Displays the selected joke's category, setup, and delivery. A back arrow will be displayed for navigating back to the joke list

Building

You can open the project in Android Studio and press run

Testing

This project uses both instrumentation tests that run on the device and local unit tests that can be run on the computer

Libraries Used

  • Foundation - Components for core system capabilities, Kotlin extensions and support for multidex and automated testing.
    • AppCompat - Degrade gracefully on older versions of Android.
    • Android KTX - Write more concise, idiomatic Kotlin code.
    • Test - An Android testing framework for unit and runtime UI tests.
  • Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
    • Data Binding - Declaratively bind observable data to UI elements.
    • Lifecycles - Create a UI that automatically responds to lifecycle events.
    • LiveData - Build data objects that notify views when the underlying database changes.
    • Navigation - Handle everything needed for in-app navigation.
    • Room - Access your app's SQLite database with in-app objects and compile-time checks.
    • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
  • UI - Details on why and how to use UI Components in your apps - together or separate
    • Fragment - A basic unit of composable UI.
    • Layout - Lay out widgets using different algorithms.
  • Third party and miscellaneous libraries
    • Koin for dependency injection
    • Retrofit for networking
    • Timber for additional logging capabilities
    • Mockito Kotlin for improved Mockito testing in Kotlin
    • Mockito for general Mockito testing capabilities
    • Gson for parsing JSON response from the JokeAPI

Notes

  • Most commits are missing due to switching over to a different repository. Normally, I commit early and commit often.
  • I began working on this project with the intention of familiarizing myself with the new Dagger Hilt framework for dependency injection and Kotlin's newer experimental coroutines. After working on learning the new frameworks and beginning the process of building out the app, I was beginning to feel rushed for time a bit given the scope of the app with testing. I eventually decided to pivot into something I was more familiar with, which is Koin. The Dagger Hilt framework seems pretty awesome and I look forward to having more time to acquaint myself with it.
  • Hypothetical next steps given more time:
    • Continue building out the test framework to allow for even greater coverage
    • Include Test Coverage reports from Jacoco to ensure coverage
    • Create Github Actions to automate CI/CD for building, testing, releasing
    • Implement refresh and scroll-down-to-refresh for a better user experience
    • Utilize Material design and adjust the theme and styles so there are less styles in any given layout file and are in a theme instead
    • Continue tweaking the UI to more of a polished look
    • Introduce some animations around the delivery of the joke (it's supposed to be funny, why not enhance it with some cool graphics and animations?)
    • Add the ability to favorite and save jokes to the local database (or Firebase potentially)

About

List-Detail view for Android utilizing the JokeAPI to display the joke setup in a list, and the joke details in the detail view.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages