jeffchao98 / kotlin-currency-practice

Use the currencylayer api to implement the Android currency table in Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kotlin-currency-practice

Outline

  • By integrate the api endpoints from CurrencyLayer , this repository has been created as the practice Android project in Kotlin, the following features also prepared in this implementation
    • The grid table for display the different currency rates
    • The dropdown menu for switch the standard currency type
    • The input box for input the target price, which will reflect on the price value of the currency cells in the grid table
    • In every 30-min, the app will automatically refresh the currency data

outline screenshot

Setup

  • Make sure you have the latest version of the Android Studio and the Android SDK in your machine
  • Because we fetch the currency rate data fron CurrencyLayer api, go through the following steps before you start compile the code
    • Prepare the access token from CurrencyLayer ( the token from free plan is OK )
    • Make sure your CurrencyLayer access token been placed in ${the project path}/local.properties as the following line
CURRENCYLAYER_TOKEN = "${your CurrencyLayer access token}"

How to generate the build

  • Like the other Android projects, you can generate your build via AndroidStudio IDE
    • For generate the debug build, find [Build] -> [Build Bundle(s) / APK(s)] -> [Build APK(s)] and wait for the popup tells you where you can find the generated build
  • If you prefer to use the cmd line to generate the build:
    • In the console, first execute cd ${project path} to move to the project folder
    • In order to generate debug build , execute ./gradlew assembleDebug
    • If success, you can find the bulild in the folder ${project path}/app/build/outputs/apk/debug , you will the file app-debug.apk as the generated build

3rd party libraries

  • Koin: Integrate the DI
  • gson: Parse the json format we get from the backend api endpoints
  • Retrofit2: In order to implement the logic for call the api endpoints and get the response data
  • Room: Keep the fetched rate data in the storage

Available builds

  • We use AppCenter to distrubute the build for review and test
  • You can directly scan the following QRCode via your android device, and choose the build you want to install in your phone
  • [Debug build]
Download list
debug list qr

About

Use the currencylayer api to implement the Android currency table in Kotlin


Languages

Language:Kotlin 100.0%