Skip to content

Kurry/WalletApplication

Repository files navigation

WalletApplication

This project is an Ethereum wallet application for Android built using Jetpack Compose, Retrofit, and Web3j. The application allows users to create an Ethereum wallet, encrypt and store the private key securely, and submit user data to a remote API.

Prerequisites

Before you begin, ensure you have the following installed on your Mac:

  1. Homebrew: Install Homebrew if it's not already installed.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Java Development Kit (JDK): Install OpenJDK 11.

    brew install openjdk@11
  3. Android Studio: Download and install Android Studio from developer.android.com.

  4. Android SDK: Ensure the Android SDK is installed via Android Studio.

  5. Git: Install Git if it's not already installed.

    brew install git

Getting Started

Clone the Repository

git clone https://github.com/Kurry/WalletApplication.git
cd WalletApplication

Open the Project in Android Studio

  1. Open Android Studio.
  2. Click on "Open an existing Android Studio project."
  3. Navigate to the cloned repository directory and select it.

Set Up Environment

Ensure all dependencies are installed. Android Studio should automatically sync the project and download the necessary dependencies.

Adding INTERNET Permission

Ensure that the INTERNET permission is declared in AndroidManifest.xml.

<uses-permission android:name="android.permission.INTERNET" />

Build and Run the Application

  1. Connect an Android device or start an Android emulator.
  2. Click on the "Run" button in Android Studio to build and run the application.

Project Structure

  • MainActivity.kt: The main activity that sets up the Compose UI.
  • WalletViewModel.kt: The ViewModel handling the business logic and data.
  • EthereumWallet.kt: Utility class for Ethereum wallet operations.
  • ApiClient.kt: Retrofit client for API interactions.

Dependencies

  • Retrofit: For network calls.
  • Web3j: For Ethereum blockchain interactions.
  • BouncyCastle: For cryptographic operations.
  • Jetpack Compose: For building the UI.

Tests

Unit Tests

  • ApiClientTest.kt: Tests the API client using MockWebServer to simulate API responses.
  • EthereumWalletTest.kt: Tests Ethereum wallet creation, encryption, and decryption operations.

Instrumentation Tests

  • EthereumWalletInstrumentedTest.kt: Runs on an actual device or emulator to test key generation, encryption, storage, and decryption.
  • RealApiClientTest.kt: Occasionally calls the real API to verify integration but is skipped by default using @Ignore annotation.

Running Tests

  1. Unit Tests: Run tests in ApiClientTest.kt and EthereumWalletTest.kt using the Run context menu in Android Studio.
  2. Instrumentation Tests: Run tests in EthereumWalletInstrumentedTest.kt and RealApiClientTest.kt on an actual device or emulator.

Follow this guide to set up and run the WalletApplication project on your Mac. Ensure you have all prerequisites installed and configured correctly. Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages