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.
Before you begin, ensure you have the following installed on your Mac:
-
Homebrew: Install Homebrew if it's not already installed.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Java Development Kit (JDK): Install OpenJDK 11.
brew install openjdk@11
-
Android Studio: Download and install Android Studio from developer.android.com.
-
Android SDK: Ensure the Android SDK is installed via Android Studio.
-
Git: Install Git if it's not already installed.
brew install git
git clone https://github.com/Kurry/WalletApplication.git
cd WalletApplication
- Open Android Studio.
- Click on "Open an existing Android Studio project."
- Navigate to the cloned repository directory and select it.
Ensure all dependencies are installed. Android Studio should automatically sync the project and download the necessary dependencies.
Ensure that the INTERNET
permission is declared in AndroidManifest.xml
.
<uses-permission android:name="android.permission.INTERNET" />
- Connect an Android device or start an Android emulator.
- Click on the "Run" button in Android Studio to build and run the application.
- 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.
- Retrofit: For network calls.
- Web3j: For Ethereum blockchain interactions.
- BouncyCastle: For cryptographic operations.
- Jetpack Compose: For building the UI.
- ApiClientTest.kt: Tests the API client using MockWebServer to simulate API responses.
- EthereumWalletTest.kt: Tests Ethereum wallet creation, encryption, and decryption operations.
- 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.
- Unit Tests: Run tests in
ApiClientTest.kt
andEthereumWalletTest.kt
using theRun
context menu in Android Studio. - Instrumentation Tests: Run tests in
EthereumWalletInstrumentedTest.kt
andRealApiClientTest.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!