Build secure and user-friendly blockchain applications with Concordium's official Android SDK
The Concordium IDApp SDK enables Android developers to seamlessly integrate Concordium blockchain functionality into their applications. This SDK provides a robust set of tools for account management, transaction signing, and secure interactions with the Concordium blockchain.
- π Secure account management and key generation
- π Transaction signing and submission
- π WalletConnect integration for ID App interactions
- π± Ready-to-use UI components
- Module:
concordium-idapp-sdk - Latest Version: Check releases
If you want to test the SDK as a binary dependency without pushing to a remote repository, publish it to your local Maven cache and consume it from there.
- Publish the SDK to your local Maven repository from the project root:
# publish all publications of the SDK module to mavenLocal
./gradlew :concordium-idapp-sdk:publishToMavenLocal- In your consumer project, make sure
mavenLocal()appears before other repositories so Gradle can resolve the locally published artifact:
repositories {
mavenLocal()
google()
mavenCentral()
}- Add the dependency using the same coordinates configured in the SDK module (
group,artifactId,version).
Example (Kotlin DSL):
dependencies {
implementation("com.concordium.sdk:concordium-idapp-sdk:0.0.1")
}Notes:
- Publishing to Maven Local is intended for local development and testing. For CI and team sharing prefer an internal Maven repository (Artifactory/Nexus/GitHub Packages).
- To remove a published local artifact, delete it from your local Maven cache (usually under
~/.m2/repository/com/concordium/sdk/concordium-idapp-sdk/<version>). - If you change
group/artifactId/versionupdate the consumer dependency accordingly.
This method is ideal for developers who want to use the SDK directly and potentially contribute back to the project.
git submodule add https://github.com/Concordium/concordium-id-kotlin-sdk.git libs/concordium-id-kotlin-sdk
git submodule update --init --recursive- Include the module in your
settings.gradle.kts(orsettings.gradle):
include(":libs:concordium-idapp-sdk")- Add a project dependency in your app module's
build.gradle.kts:
dependencies {
implementation(project(":libs:concordium-idapp-sdk"))
implementation("com.concordium.sdk:concordium-android-sdk:11.1.0")
}π‘ Tips:
- Run Gradle sync after adding the dependency
- Check releases page for the latest version
Call the initializer early in your app (for example, in Application.onCreate):
import com.concordium.idapp.sdk.api.ConcordiumIDAppSDK
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
ConcordiumIDAppSDK.initialize(this, enableDebugLog = false) // Important for popup actions
}
}The SDK provides a clean and intuitive API through three main components:
Core functionality for blockchain interactions:
initialize(context: Context, enableDebugLog: Boolean = false)signAndSubmit(seedPhrase: String, expiry: Long, unsignedCdiStr: String, accountIndex: Int = 0, network: Network = Network.MAINNET): StringgenerateAccountWithSeedPhrase(seed: String, network: Network, accountIndex: Int = 0): CCDAccountKeyPairclear()
UI components and flows for user interactions:
invokeIdAppDeepLinkPopup: Launch WalletConnect flowsinvokeIdAppActionsPopup: Present account creation/recovery optionsclosePopup: Dismiss active popups
Essential account data model:
publicKey: Account's public verification keysigningKey: Account's signing key
Here are some common use cases to help you get started:
Make sure unsignedCdiStr contains a valid JSON string matching UnsignedCredentialDeploymentInfo.
import com.concordium.idapp.sdk.api.ConcordiumIDAppSDK
import com.concordium.sdk.crypto.wallet.Network
fun submit(seedPhrase: String, unsignedCdiJson: String) {
val expiryEpochSec = 1710000000L // choose appropriate expiry
val txHash = ConcordiumIDAppSDK.signAndSubmit(
seedPhrase = seedPhrase,
expiry = expiryEpochSec,
unsignedCdiStr = unsignedCdiJson,
accountIndex = 0,
network = Network.MAINNET,
)
println("Transaction hash: $txHash")
}import com.concordium.idapp.sdk.api.ConcordiumIDAppPopup
val walletConnectUri = "wc:...@2?relay-protocol=...&symKey=..."
ConcordiumIDAppPopup.invokeIdAppDeepLinkPopup(walletConnectUri)ConcordiumIDAppPopup.invokeIdAppActionsPopup(
walletConnectSessionTopic = "abcd1234...",
onCreateAccount = { /* handle create */ },
onRecoverAccount = { /* handle recover */ },
)import com.concordium.idapp.sdk.api.ConcordiumIDAppSDK
import com.concordium.idapp.sdk.api.model.CCDAccountKeyPair
import com.concordium.sdk.crypto.wallet.Network
fun showKeys(seed: String) {
val keys: CCDAccountKeyPair = ConcordiumIDAppSDK.generateAccountWithSeedPhrase(
seed = seed,
network = Network.MAINNET,
accountIndex = 0,
)
println("publicKey=${keys.publicKey}")
println("signingKey=${keys.signingKey}")
}When you're done using the SDK, make sure to clean up resources:
ConcordiumIDAppSDK.clear()The SDK seamlessly integrates with both production and testing environments:
- URL:
https://grpc.mainnet.concordium.software - Use Case: Production deployments
- Default Port:
20000
- URL:
grpc.testnet.concordium.com - Use Case: Development and testing
- Default Port:
20000
The SDK is built with industry-standard technologies:
- Jetpack Compose for UI components
- ZXing for QR code generation
- Concordium Android SDK for blockchain interactions
Follow these steps to publish a new version of the SDK:
-
Ensure you are on the
mainbranch and it is up to date:git checkout main git pull origin main
-
Make sure all tests pass and the build is successful:
./gradlew clean build test -
Update the version number in
concordium-idapp-sdk/build.gradle.kts:- Follow semantic versioning (MAJOR.MINOR.PATCH)
- Example:
version = "1.0.0"
-
Commit the version change:
git add concordium-idapp-sdk/build.gradle.kts git commit -m "Bump version to x.y.z" -
Create and push a new tag:
git tag -a vx.y.z -m "Release version x.y.z" git push origin main --tags -
Create a release on GitHub:
- Go to the repository's Releases page
- Click "Create a new release"
- Select the tag you just created
- Title: "Release vx.y.z"
- Add release notes describing the changes
- Attach any relevant binaries or documentation
Notes:
- Replace x.y.z with the actual version number
- Always create releases from the
mainbranch - Ensure all changes are properly documented
- Follow semantic versioning guidelines:
- MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes (backwards compatible)
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Open a Pull Request
Please ensure your code follows our coding standards and includes appropriate tests.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Need help? We're here for you!
- π Create an issue for bug reports or feature requests
- Always call
ConcordiumIDAppSDK.initialize(context)before any other function. signAndSubmitparses theunsignedCdiStrJSON; ensure it is valid. The function will throw if parsing fails.- Network calls use the Concordium Java/Kotlin client; ensure correct network selection (
Network.MAINNETvsNetwork.TESTNET) and permissions.