With this simple app, you can keep track of your favourite cryptocurrency on your wrist.

Overview

GitHub release (latest by date)

Capstone project crypto Tracker

🏁 Final Product (05-06) V1.1 "somebody toucha my spaghet"

feature set State Note
Track the current price of a crypto coin βœ”οΈ With the use of the Coin Gecko API
Add coins to keep track of βœ”οΈ
Detailed screen with statistics of selected coin βœ”οΈ
Option to set a coin as a favourite for the Tile βœ”οΈ Is will be the coin that should be on the Tile
Show quick statistics on a Tile ❌ Making a tile is nothing like Compose
Remove a coin for the tracking list βœ”οΈ
Show a chart of the price history βœ”οΈ
Option to change the currency βœ”οΈ Done with SharedPreferences
Optional to set the history dept in days βœ”οΈ Done with SharedPreferences
Option to change styling of the app ❌
Per devices a collection of coins to track βœ”οΈ With the use of SharedPreferences instead of FireStore
Optimized API call ❌ In need of a new API for the project

See the GIF below for a short overview of the final (for now) product.

πŸ“² Download APK

V1.1 "somebody toucha my spaghet"

see the release notes for more information and release notes per version:

Releases notes

πŸ”œ What is next

The app still is missing a Tile, so that is the first thing that needs work.

Furthermore the CoinGecko API is oke, but the need of API that can handle a list of coin is high. Now for each coin the app makes about 2/3 calls. And when the users has a bunch of coin in their app, the amount of API calls grows very quickly.

The app has been tested on a single device, but when the app is used by multiple user, there is no way yet to keep track of a separate list of "favorite coins" per device, so that every device can have a unique list.

Rolling the app out into the app store.

πŸ›  Built With

  • Kotlin - First class and official programming language for Android development.
  • Jetpack Compose - Jetpack Compose is Android’s modern toolkit for building native UI.
  • Coroutines - A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously.
  • Flow - A flow is an asynchronous version of a Sequence, a type of collection whose values are lazily produced.
  • Firebase - Firebase is an app development platform that helps you build and grow apps users love. Backed by Google and trusted by millions of businesses.
  • CoinGecko Kotlin - Multiplatform Kotlin wrapper for the CoinGecko API using Ktor.
  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
    • Stateflow - StateFlow is a state-holder observable flow that emits the current and new state updates to its collectors.
    • Flow - A flow is an asynchronous version of a Sequence, a type of collection whose values are lazily produced.
    • ViewModel - Stores UI-related data that isn"t destroyed on UI changes.
    • Jetpack Compose Navigation - The Navigation component provides support for Jetpack Compose applications.
  • Material Components for Android
    • Modular and customizable Material Design UI components for Android.
  • Figma - Figma is a vector graphics editor and prototyping tool which is primarily web-based.

πŸ“¦ Package Structure

com.krakert.tracker
β”œβ”€β”€ model                 # Model class for [Coins], [Coin] & [Favorite]
β”œβ”€β”€ navigation            # For navigation handling
β”œβ”€β”€ repository            # Used to handle all data operations
β”œβ”€β”€ state                 # State class to handle state of the data
β”œβ”€β”€ theme                 # Theme setup for this app
β”œβ”€β”€ tile                  # Tile and custom repository for it
β”œβ”€β”€ ui                    # All composables screens root folder
β”œβ”€β”€ viewmodel             # ViewModels 
β”œβ”€β”€ SharedPreference.kt   # SharedPreference to save user settings
└── MainActivity.kt       # MainActivity 

⌚ About the capstone (idea)

For the capstone, I'm going to create an app that can display crypto statistics. During the IoT theme semester I made a similar application, only this one was not for mobile. So now I'm going to recreate this for Android. Furthermore, the app will be a complete stand-alone app for Wear OS to challenge myself.

Make

The app will consist of 2 parts, a tile, and the overlay. Via the tile, the user can retrieve the latest statistics of his favorite currency in an easy and simple way. The overlay provides more information about different coins and here users can get more details about a coin.

overlay

To realize this app I will make a simple layout where the user will see a simple graph per coin, in which the lowest, highest and current price of the coin is displayed. Navigation will be within the overlay with swipes. For example, the user can retrieve additional information about a coin by swiping right on the coin of his choice. this screen will become a small list about the coins and will contain additional stats, this will display things like price and 'market cap'. At the bottom of the list in the overlay is the option to add additional coins to the list.

Tile

Tiles provide easy access to the information and actions users need to get things done in seconds. With a simple swipe from the watch face, a user can see how their favorite coin is doing. This tile does not offer too much information so that the user can see at a glance what it is all about.

User stories

Epic: As a user I want an app that allows me to keep track of my favorite crypto coins on my watch. Per coin I have a graph showing the price of the market. With a few swipes I want to know everything about the coin and add or remove coins from my list.

  • Objective
    • As a user I want to be able to see the current price of a coin so that I can see whether it is rising or falling
    • As a user I want to see more stats about a coin like
    • As a developer, you want to be able to make an API call via Wear OS
    • As a developer likes to use different elements and gain basic knowledge
  • Optional
    • As a user I would like to be able to quickly retrieve extra information about my favorite coin
    • As a developer I would like to make a graph of current data of the coin

🎨 UI Design

Overlay Add a coin to track Details about a selected coin Tile

πŸͺ² Connect watch to debugger

  • On the phone, open the Wear OS companion app.
  • Scroll down to Advanced Settings and tap to view the Advanced Settings options.
  • Enable Debugging over Bluetooth. A status message appears under the option. It looks like this:
Host: disconnected
Target: connected

At this point the development machine (the host) is not communicating with the watch (the target). You need to complete the link.

In this final step, you'll use everything: the debugger, the phone, and the watch.

  • Connect the phone to your development machine with a USB cable.
  • Run these two commands in the debugger/terminal:
adb forward tcp:4444 localabstract:/adb-hub
adb connect 127.0.0.1:4444
  • After you type the connect command, look at the watch. It will ask you to confirm that you are allowing ADB Debugging.
  • On the phone, check the status display in the Wear OS companion app. It should look like this:
Host: connected
Target: connected

The watch is now connected to the debugger and you're ready to start debugging.

When you debug a watch using Bluetooth, adb always uses the IP address 127.0.0.1 plus the port that you assigned. In this example, the port is 4444. All adb commands use the following format:

adb -s 127.0.0.1:4444  

❀️ Support my work

Buy Me A Coffee

Comments
  • WIP: Handle HTTP 429

    WIP: Handle HTTP 429

    When a user makes too many requests to the API, they will reach the API limits and will encounter an HTTP 429 response. Needs to handle that response better.

    bug 
    opened by Krakert 2
  • Add option to specify the refresh rate of the data

    Add option to specify the refresh rate of the data

    Now all the data in the app is loaded when the view is loaded, but a caching layer is being added, let the user define the time of the refresh. So a slider that defines the interval of the data, from example: 1 to 10 minute

    enhancement 
    opened by Krakert 1
  • Homepage is scrollable when no coins are present

    Homepage is scrollable when no coins are present

    The home activity becomes scrollable after removing all coins from the list. This behavior is not present when loading the app for the first time. The steps to reproduce are:

    1. Start app
    2. Add coins
    3. Remove all coins
    bug 
    opened by Bart2000 1
  • Cache layer

    Cache layer

    This version of the app Implements a lot of new stuff under the hood. Now the project has:

    • Dependency injection with Hilt
    • Cache rate limiter
    • ROOM database
    • Better error handeling
    • Side Effects
    enhancement 
    opened by Krakert 0
  • Make cache invalid when:

    Make cache invalid when:

    The data in de cache needs to be refreshed/marked invalid:

    - A user adds a new coin to track Invalid cacheKeyPricesCoins reload data into priceCoinsTable

    - A user changes the settings of the dept of the market chart Invalid cacheKeyMarketChart reload data into marketChartTable

    - A user changes the currency in the settings Invalid cacheKeyMarketChart, cacheKeyPricesCoins and cacheKeyDetailsCoin reload data in: marketChartTable, priceCoinsTable and detailsCoinTable

    bug 
    opened by Krakert 0
  • Change the stateflow of OverviewCompose

    Change the stateflow of OverviewCompose

    Currently, the OverviewCompose compose has two state flows, let's reduce it to just one, that way switching to an error state is easily done.

    When the favourite coins are loaded in from the shared preference the state switches to Success (val response by viewModel.favoriteCoins.collectAsState()) and in this state, we try to load the data of the coins, but when that fails, because of 429 or 404 HTTP response we are stuck in a ScalingLazyColumn that is in the Success state, and there is no way set the favoriteCoins.collectAsState() to Error to show an error message.

    With just a single StateFlow the code won't get stuck in a specific StateFlow and we can more easily jump to different states.

    bug 
    opened by Krakert 0
  • Api refactor

    Api refactor

    Complete rework of the API calls

    the project is now no longer dependent on a Firebase document to retrieve the coins a user can add to track. This is now handled by the API call: /coins/markets from the Coin Gecko API.

    Besides that, the project was using CoinGecko Kotlin wrapper by Drew Carlson to make all the API calls. Now, this is all done with the help of Retrofit 2, okhttp3 and Gson.

    Furthermore, for retrieving the last price of a coin, separate API calls are no longer made per coin id as before. Now with the API call: /simple/price all prices are retrieved at once by passing an array list, this data is then mapped to a MutableMap. Later the historical data is added to this map, this is still done by the /coins/{id}/market_chart API call.

    So if a user had 4 coins: old code base: 8 API calls (4 for the latest price, 4 for the historical data) New code base: 5 API calls (1 for the latest price, 4 for the historical data)

    So to @pmeijer-hva :heart:

    opened by Krakert 0
  • Problem with the navigation

    Problem with the navigation

    When a coin is removed from the list of favourite coins, the back stack should also be updated, when a back swipe is done it navigates to the page of the coin that is just removed.

    opened by Krakert 0
  • App crashes on fresh install

    App crashes on fresh install

    When the app is installed for the first time, the app can not start:

    E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-3
        Process: com.krakert.tracker, PID: 15131
        java.lang.NullPointerException: Gson().fromJson(dataSharedPreference, typeOfT) must not be null
            at com.krakert.tracker.viewmodel.OverviewViewModel$getFavoriteCoins$1.invokeSuspend(OverviewViewModel.kt:44)
            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
            at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
            at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
            at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
            at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
            at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
            at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
            at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
    
    bug 
    opened by Krakert 0
  • Project is still not state effect free

    Project is still not state effect free

    The project is nog state effect free and therefore it does too many API Calls and recomposes the Lay-out too much. We can see this best on slower hardware.

    enhancement 
    opened by Krakert 0
  • Add indication to the coin list

    Add indication to the coin list

    This indiction, tells the user that the coin is already added to the list of coins they want to follow. This eliminates the need to press a chip twice.

    enhancement 
    opened by Krakert 0
Releases(V1.1)
  • V1.1(Jun 6, 2022)

    In this new version, users will not, "toucha somebodies spaghet" and users can all have their unique list of coins to track.

    Previously the list of coins to track was a single FireStore document that stored this information, but the problem lies in the word "single", so all users will have the same list. That's not wanted so in this update the list of coins to track is stored the same way the settings are stored "SharedPreferences".

    Full Changelog: https://github.com/Krakert/Crypto-Tracker/compare/V1.0...V1.1

    Source code(tar.gz)
    Source code(zip)
    Crypto_Tracker_V1.1.apk(19.22 MB)
Android app that helps you keep track of the medical supplements you need to take and how you spend your days

Android app that helps you keep track of the medical supplements you need to take and how you spend your days, similar to a bullet journal. It also allows you to reflect on your day, week, year, etc.

Rachelle Hu 4 Nov 10, 2022
Task Timer - An android app that helps you to keep a track of how much time you spend on each task

Task Timer - An android app that helps you to keep a track of how much time you spend on each task

Hassan Al-Shammari 1 Feb 24, 2022
This app aims at helping people keep track of their job applications, and remind them regularly about the same.

Applications Tracker Lately I have been applying for many roles, and it has become a hard task to keep track of all the applications. Spreadsheets are

Kartik Pant 4 Feb 20, 2022
Keep track of popular & top rated movies and see movie details

Movies Keep track of popular & top rated movies and see movie details Features Keep track of popular & top rated movies See movie details Libraries Je

Amr Saraya 1 May 1, 2022
A news app made using android studio in Java with features like favourite news, Location detector for local news, and especially made with HUAWEI APIs

HuaweiGlobalNewsApp A news app made using android studio in Java with features like favourite news, Location detector for local news, and especially m

Christian Imanuel Hadiwidjaja 1 Oct 30, 2021
A simple and minimal app to track how long you've been sober from anything you want.

Sobriety A simple and minimal app to track how long you've been sober from anything you want. I mostly designed this out of spite for "I Am Sober", wh

Katherine Rose 26 Nov 21, 2022
A Clean Architecture Cryptocurrency App (MVVM, Use Cases, Compose)

A Clean Architecture Cryptocurrency App (MVVM, Use Cases, Compose)

Shaima Abdulmohsin 2 Aug 4, 2022
A cryptocurrency data aggregator that tracks price, volume, social stats.

CryptoMania A cryptocurrency data aggregator that tracks price, volume, social stats. Challenge description Design & implement an Android application

Gabriel TEKOMBO 23 Aug 6, 2022
an attempt to learn basics of blockchain and cryptocurrency

basicBiedaCoin An attempt to learn basics of blockchain and cryptocurrency Useful sources: But how does bitcoin actually work? Implementing a Simple B

Dawid Urbanowski 1 Oct 29, 2021
Sunlight Apk - Sunlight App where You can decide Your Mood and Relative suggestions of what you can do will be displayed

Sunlight_Apk This Is a App where You can decide Your Mood and Relative suggestio

Jadu 1 Feb 5, 2022
An interesting workout app, that can track your progress (unfinished)

7MinuteWorkout An interesting workout app, that can track your progress (unfinished) U planu mi je da odradim bolji dizajn za ovu aplikaciju. Za sada

null 2 May 8, 2022
A minimalist but powerful productivity timer designed to keep you focused and free of distractions.

Goodtime A minimalist but powerful productivity timer designed to keep you focused and free of distractions. Alternate between focused work sessions a

Adrian Cotfas 692 Dec 27, 2022
Money Manager app that helps you to add your daily small incomes and expenses and track them easily.

Simple Money Manager This app is a simple money manager app which helps you to add your daily small incomes and expenses and track them easily. Screen

Yash Bansal 2 Nov 21, 2021
Cryptac is a mobile application that allows you to track the main important information about your favorite cryptos

Cryptac is a mobile application that allows you to track the main important information about your favorite cryptos.

null 1 Jan 21, 2022
Vaibhav Jaiswal 57 Jan 3, 2023
A distribution of performance-oriented Bukkit patches that aims to keep stability and vanilla behaviour

Patina A distribution of performance-oriented Bukkit patches that aims to keep stability and vanilla behaviour. You can find explanation of configurat

null 107 Dec 26, 2022
An App based on MVVM architecture to track & store a user's runs using Google Maps, with options to view & sort the runs as per the user's choice along the with option to run the app in background.

An App based on MVVM architecture to track & store a user's runs using Google Maps, with options to view & sort the runs as per the user's choice along the with option to run the app in background.

Harshit Maheshwari 1 Jun 9, 2022
A news application through which you can learn and browse all the news that interests you by choosing the country and type of news with the ability to browse and add some news to your favorites

MY-NEWS-Android A news application through which you can learn and browse all the news that interests you by choosing the country and type of news wit

Mahmoud ELramady 0 Nov 11, 2021