Skip to content

Android application for managing cryptocurrency portfolio

License

Notifications You must be signed in to change notification settings

Yann39/my-crypto-binder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyCryptoBinder

Android application for managing cryptocurrency portfolio.

Version Static Badge

Version Version Version

Version


Table of Contents

About the project

Android logo Java logo SQLite logo SQLite logo

Important

DISCLAIMER I started this project to play around with Android architecture components for my own knowledge. I do not pretend the code is a reference. Some functionalities and checks might be missing or incomplete. This project is not intended to be used in a production environment.

The purpose of this application is to allow easy retrieval of trading data from online cryptocurrency exchanges. It only allows visualization of data, it can NOT be used as a trading platform.

It has been kept very simple, by gathering only trading data needed to calculate your portfolio value and some statistics.

It is directly connected to major exchanges so you don't have to manually fill the orders.

Here is the currently supported exchanges :

Screenshots

Homepage screenshot Transactions page screenshot Edit transaction page screenshot BTC price graphic screenshot ICO list screenshot Exchanges selection screenshot Exchange synchronization page screenshot Backup/restore page screenshot

Usage

  1. Create API keys in your favorite exchange platform (read only recommended)
  2. In the application, go to the settings page, then in the Exchanges menu, edit the concerned exchange to add the related keys (public and private)
  3. Still in the settings page, click the 'synchronize' button under the Synchronize with exchanges menu
  4. Enjoy a beer watching your million dollars

Technical details

Compatibility

  • Minimum SDK : 19 (Android Kitkat)
  • Targeted SDK : 27 (Android Oreo)

Main theme is based directly on the raw Material Theme for Android 5.0 (API 21) and above, else a Theme.AppCompat theme is used.

Thereby the Support libraries have been used for backward compatibility (v7). It adds support for the Action Bar user interface design pattern and includes support for material design user interface implementations (RecyclerView, CardView, etc.). The following ones have been used :

Technologies

  • Java 8
  • SQLite as basic embedded database
  • Android architecture components
    • ViewModel helper class to facilitate the MVVM architecture
    • LiveData as data holder, to keep data up to date by respecting application lifecycle
    • Paging library for displaying large sets of data (paged lists)
    • Room as persistence library (with singleton database instance)
  • Retrofit 2 as HTTP client helper (with GSON2). A logging interceptor has also been used for logging with OkHttp 3 (Retrofit 2 completely relies on OkHttp for any network operation).
  • MPAndroidChart library for charts

Architecture

Application has been implemented using the MVVM (Model-View-ViewModel) pattern as described below :

flowchart TB

    style VIEW fill: #205566
    style VIEWMODEL fill: #205566
    style ADAPTER_VIEWHOLDER fill: #205566
    style ROOM fill: #205566
    style MODEL fill: #205566
    style SERVICE fill: #205566
    style REPOSITORY fill: #3d681b
    style API fill: #806030
    style DATABASE fill: #804030

    subgraph VIEW
        ACTIVITY_FRAGMENT(Activity / Fragment)
    end

    subgraph VIEWMODEL
        LIVEDATA_OBSERVER(LiveData / Observer)
    end

    ADAPTER_VIEWHOLDER[Adapter / ViewHolder]

    REPOSITORY[Repository]

    subgraph ROOM
        DAO(DAO)
        ENTITY(Entity)
    end

    DATABASE[(SQLite)]

    MODEL[Model]

    subgraph SERVICE
        RETROFIT(Retrofit)
    end

    API{{Exchanges API}}

    VIEWMODEL --> ADAPTER_VIEWHOLDER
    VIEW --> VIEWMODEL
    VIEWMODEL --> REPOSITORY
    VIEWMODEL -.-> MODEL
    REPOSITORY ---> ROOM
    REPOSITORY --> MODEL
    ROOM --> DATABASE
    MODEL --> SERVICE
    SERVICE --> API
    
    
Loading

Code structure

Application code has been organized with the following package structure :

  • activities : UI interaction classes
  • adapters : underlying views datasets management classes
  • components : custom components / decorators
  • dao : database access object interfaces
  • entities : database entity classes
  • helpers : helper classes
  • managers : manager classes that acts as proxy between viewmodels and daos/services
  • models : simple model classes (mainly used for services)
  • services : services classes responsible for calling web services
  • viewholders : view holder classes that holds view elements to speed up rendering
  • viewmodels : viewmodel classes that store and manage UI-related data

Mechanics

Data got from online exchanges are stored in the local SQLite database :

  • all assets from different exchanges are merged into a single CURRENCY table
  • all trades from different exchanges are merged into a TRANSACTIONS table

Note: same currencies with different names are merged (ie. Kraken XBT becomes BTC).

That way we have a simple EXCHANGE - CURRENCY - TRANSACTIONS relation, and have no need to call exchange API each time. Simply resynchronize the exchanges on which you performed new operations (from the settings menu) to get up-to-date data.

Privacy

This privacy policy sets out how we use and protect any information that you give when you use this application.

Should we ask you to provide certain information by which you can be identified when using this application, then you can be assured that it will only be used in accordance with this privacy statement.

We may change this policy from time to time by updating this page. You should check this page from time to time to ensure that you are happy with any changes.

What personal information do we collect from people using the app?

When using this application, you may only be asked to enter your exchange public and private API keys so we can retrieve your public and private exchange data. We will NEVER ask you to provide any credit card number, wallet private key or other sensitive data.

The application may communicate with mentioned exchanges and with the CryptoCompare API to get live trading data.

Thereby we may collect the following information:

  • any data available from the API related to the exchange(s) you have linked
  • any data you may manually enter in the app

What we do with the information we gather

We simply use that information to display your trading data and some statistics.

We will not sell, distribute or lease any of your personal information to third parties. We will never transmit any data about a user without obtaining its prior permission and providing information about how and where the data will be used.

We will never display any advertising and/or send you promotional information about third parties.

Security

Raw data is only stored in the local embedded SQLite database. Once in the app, it will never be sent over the network to any centralized server. Keys are AES encrypted before storage.

Android Auto backup is disabled, so application data will not be sent to your Google Drive account. If you need to backup your data, please use the backup/restore functionality from the Settings menu.

The backup/restore functionality writes CSV files to the internal storage in the application-specific directory so it does not require any additional permission. Your keys will remain AES encrypted in the backed up file.

I have planned to use Android Keystore System in the near future to store the exchange API keys but for the moment I simply used an AES encryption.

Therefore, we cannot guarantee the security of your data as any APK file can be easily decompiled. It's up to you to keep your application and related data in safe hands.

Controlling your personal information

You can decide at any time to remove this application and your data will be gone with.

License

General Public License (GPL) v3

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Known issues (Apr 2018)

  • Bittrex API is broken and does not allow to retrieve order history
  • Bitfinex API order history is limited to last 3 days and 1 request per minute -> use "Past Trades" endpoint that must be called for each pair...
  • Backup / restore functionality simply backup and restore the exchanges list
  • Paging need to be refactored because of deprecated methods

Releases

No releases published

Packages

No packages published

Languages