Native Android Swarm Node
This is a native Android application for running a Swarm node on Android devices. The project includes a Swarm wrapper implementation that you can use in your own Android app to interact with Swarm network.
swarm-mobile-android-native/
├── app/ # Android application module
│ ├── build.gradle # Application build configuration
│ └── src/main/
│ ├── AndroidManifest.xml
│ ├── java/com/swarm/mobile/ # Main app code
│ └── res/ # Resources (layouts, strings, etc.)
├── swarmlib/ # Swarm library module (builds to .aar)
│ ├── build.gradle # Library build configuration
│ ├── libs # place bee-lite.aar file and jar here
│ └── src/main/
│ ├── AndroidManifest.xml
│ └── java/com/swarm/lib/
│ └── SwarmNode.java # Swarm wrapper implementation
├── build.gradle # Root build configuration
├── settings.gradle # Project settings
└── gradle/ # Gradle wrapper
- Android SDK (API level 21 or higher)
- Java 17 or higher
- Gradle 8.13 or higher
Follow the instructions at bee-lite-java repository to get the binary.
Copy the .aar file and the .jar into the swarmlib/libs/ directory.
At build.gradle these files already referenced but double check implementation(name: 'mobile', ext: 'aar') - rename if you wish.
More help in this topic here in a POC
./gradlew :swarmlib:assembleReleaseThe .aar file will be generated at: swarmlib/build/outputs/aar/swarmlib-release.aar
./gradlew :app:assembleDebugThe APK will be generated at: app/build/outputs/apk/debug/app-debug.apk
./gradlew buildSwarmNodeclass with lifecycle management
- Material Design UI with card-based layout
- Node information display (Node ID, Status)
- Start/Stop controls for the Swarm node in ultra-light or light mode
- Real-time status updates
- Download functionality using Swarm hash
- List / Buy Stamps for upload
- Simple file upload to Swarm with upload history
- Build the app using Gradle
- Install the APK on an Android device (API 21+)
- Launch the "Swarm Mobile" app
- Select "Ultra-Light Mode"
- Tap "Start Node" to start the Swarm node
- Enter swarm hash to download
- Build the app using Gradle
- Install the APK on an Android device (API 21+)
- Launch the "Swarm Mobile" app
- Select "Light Mode"
- Fill required RPC Endpoint (e.g. https://xdai.fairdatasociety.org)
- Tap "Start Node" to start the Swarm node
- After Wallet Address appears need to fund the wallet. Recommended to use this app
- Recommended minimal 0.1xDai for the node to be able to deploy a Chequebook and a fex xBZZ for postage batches.
- Restart App
- After the node shows "Running" status and has connected peers then on the Upload tab Stamps should be bought for upload with the "Create" button.
- Select Stamp from the list
- Browse a file to upload and tap "Upload" button
- After upload completes the file hash will be shown in the upload history list
- Add in app lint to the fund app with prefilled address and amount
- Hash quick share
- Upload complete folder
- Upload multiple selected files at once
- Stamp estimated cost calculator before buy
- Stamp estimated validity calculator before buy
- Stamp remaining validity display
- Availability of the uploaded content in the history list (based on the used stamp)
- Stamp Topup and Dilude functionality
The app is written in Java 17 and uses:
- AndroidX libraries
- Material Components for Android
- Gradle build system
- Minimum SDK: API 21 (Android 5.0)
- Target SDK: API 36 (Android 16)
This project uses Gradle 8.13, which is compatible with:
- Android Gradle Plugin 8.7.3
- Java 17-21
- Android Studio Ladybug (2024.2.1) and later