{"id":28405050,"url":"https://github.com/flexa/flexa-android","last_synced_at":"2025-08-23T13:09:28.448Z","repository":{"id":253281940,"uuid":"843038714","full_name":"flexa/flexa-android","owner":"flexa","description":"Flexa SDK for Android","archived":false,"fork":false,"pushed_at":"2025-05-22T08:13:00.000Z","size":1296,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-29T04:37:01.388Z","etag":null,"topics":["android","flexa","kotlin"],"latest_commit_sha":null,"homepage":"https://flexa.co","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-15T16:43:04.000Z","updated_at":"2025-06-23T11:28:05.000Z","dependencies_parsed_at":"2024-08-15T18:33:18.629Z","dependency_job_id":"e5bddfdc-18a1-4b8f-90ee-3b640a5df2cd","html_url":"https://github.com/flexa/flexa-android","commit_stats":null,"previous_names":["flexa/flexa-android"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/flexa/flexa-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexa%2Fflexa-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexa%2Fflexa-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexa%2Fflexa-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexa%2Fflexa-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexa","download_url":"https://codeload.github.com/flexa/flexa-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexa%2Fflexa-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271748836,"owners_count":24814063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flexa","kotlin"],"created_at":"2025-06-01T21:10:35.592Z","updated_at":"2025-08-23T13:09:28.428Z","avatar_url":"https://github.com/flexa.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://flexa.network/static/4bbb1733b3ef41240ca0f0675502c4f7/66640/flexa-logo%403x.png\" width=\"28\"\u003e Flexa for Android\n\nWith Flexa, you can quickly and easily add new modules of functionality to your wallet app.\n\nIn the current release, Flexa offers a privacy-focused payments experience for in-person and online spending anywhere Flexa is accepted (Spend), along with a simple scanner module for parsing QR code–formatted payment requests (Scan).\n\n## Modules structure\n\n| Module        | Description                                            |\n| ------------- | ------------------------------------------------------ |\n| Flexa   | Core functionality required by all other modules       |\n| Spend | Instant retail payments, powered by Flexa              |\n\n## Installation\n\nFlexa can be integrated using **package repository** or **locally**\n\n### Package repository\n\n#### Maven Central\n\nAdd module dependency in your project [module-level build.gradle](https://developer.android.com/studio/build#module-level) file:\n```groovy\nimplementation 'co.flexa:core:1.1.2'\nimplementation 'co.flexa:spend:1.1.2' // includes core library\n```\n\n\n#### GitHub Package Registry\n\n1. Set flexa username and access token to a project [local.properties](https://developer.android.com/build#properties-files) file:\n   :warning: *Note: this file must *NOT* be checked into Version Control Systems*:warning:\n\n    ```properties\n    gpr.user=flexa\n    gpr.key=access_token\n    ```\n\n2. Add GitHub Package Registry repository to the [settings.gradle](https://developer.android.com/build#settings-file) file:\n\n    ```groovy\n    dependencyResolutionManagement {\n        ...\n        repositories {\n            ...\n            maven {\n                name = \"GitHubPackages\"\n                url = uri(\"https://maven.pkg.github.com/flexa/flexa-android\")\n                credentials {\n                    def propertiesFile = file(\"local.properties\")\n                    def localProperties = new Properties()\n                    localProperties.load(new FileInputStream(propertiesFile))\n                    username = localProperties['gpr.user'] ?: \"\"\n                    password = localProperties['gpr.key'] ?: \"\"\n                }\n            }\n        }\n    }\n    ```\n\n3. Add module dependency in your project [module-level build.gradle](https://developer.android.com/studio/build#module-level) file:\n\n    **Identity** module:\n\n    ```groovy\n    implementation \"com.flexa:core:1.1.2\"\n    ```\n\n    **Spend** module:\n\n    ```groovy\n    implementation \"com.flexa:spend:1.1.2\"\n    ```\n\n### Local repository\n\n1. Run the next buildScript from the SDK root folder:\n\n```groovy\n./gradlew core:assembleDebug \u0026\u0026 ./gradlew core:publishToMavenLocal \u0026\u0026 ./gradlew spend:assembleDebug \u0026\u0026 ./gradlew spend:publishToMavenLocal\n\n```\n\n2. Add `mavenLocal()` repository to `settings.gradle`:\n\n```groovy\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        ...\n        mavenLocal() \u003c---\n    }\n}\n```\n\n3.  Add module dependency in your project [module-level build.gradle](https://developer.android.com/studio/build#module-level) file:\n\n**Identity** module:\n\n```groovy\nimplementation \"com.flexa:core:1.1.2\"\n```\n\n**Spend** module:\n\n```groovy\nimplementation \"com.flexa:spend:1.1.2\"\n```\n\n## Usage\n\n1. The SDK initialization:\n\n    ```kt\n    val accountId = \"Account ID\"\n    val accountIdSha256 = MessageDigest.getInstance(\"SHA-256\")\n        .digest(accountId.toByteArray())\n        .fold(\"\") { str, it -\u003e str + \"%02x\".format(it) }\n    Flexa.init(\n        FlexaClientConfiguration(\n            context = applicationContext,\n            publishableKey = \"key\",\n            theme = FlexaTheme(\n                useDynamicColorScheme = true,\n            ),\n            assetAccounts = arrayListOf(\n                AssetAccount(\n                    assetAccountHash = accountIdSha256,\n                    displayName = \"My Wallet\",\n                    icon = \"https://flexa.network/static/4bbb1733b3ef41240ca0f0675502c4f7/d8419/flexa-logo%403x.png\",\n                    availableAssets = emptyList()\n                )\n            ),\n            webViewThemeConfig = \"{\\n\" +\n                    \"    \\\"android\\\": {\\n\" +\n                    \"        \\\"light\\\": {\\n\" +\n                    \"            \\\"backgroundColor\\\": \\\"#100e29\\\",\\n\" +\n                    \"            \\\"sortTextColor\\\": \\\"#ed7f60\\\",\\n\" +\n                    \"            \\\"titleColor\\\": \\\"#ffffff\\\",\\n\" +\n                    \"            \\\"cardColor\\\": \\\"#2a254e\\\",\\n\" +\n                    \"            \\\"borderRadius\\\": \\\"15px\\\",\\n\" +\n                    \"            \\\"textColor\\\": \\\"#ffffff\\\"\\n\" +\n                    \"        },\\n\" +\n                    \"        \\\"dark\\\": {\\n\" +\n                    \"            \\\"backgroundColor\\\": \\\"#100e29\\\",\\n\" +\n                    \"            \\\"sortTextColor\\\": \\\"#ed7f60\\\",\\n\" +\n                    \"            \\\"titleColor\\\": \\\"#ffffff\\\",\\n\" +\n                    \"            \\\"cardColor\\\": \\\"#2a254e\\\",\\n\" +\n                    \"            \\\"borderRadius\\\": \\\"15px\\\",\\n\" +\n                    \"            \\\"textColor\\\": \\\"#ffffff\\\"\\n\" +\n                    \"        }\\n\" +\n                    \"    }\\n\" +\n                    \"}\"\n            )\n        )\n\n    ```\n\n2. Start Spend or Identity module:\n\n    ```kt\n    // Spend\n    Flexa.buildSpend()\n        .onTransactionRequest { transaction -\u003e }\n        .build().open(activity)\n    \n    // Identity\n    Flexa.buildIdentity()\n        .onResult { result -\u003e\n            connectResult = when (result) {\n                is ConnectResult.Connected -\u003e {}\n                else -\u003e {}\n                }\n        }\n        .build()\n        .open(activity)\n\n    ```\n\n### Payment Flow\n\n1. Open the spend module\n\n    ```kt\n    Flexa.buildSpend()\n        .onTransactionRequest { transaction -\u003e \n        \n        }\n        .open(activity)\n    ```\n\n2. Choose your asset and scan the flexcode\n3. Get the transaction details in `onTransactionRequest` listener:\n\n    ```kt\n    ...\n        .onTransactionRequest { transaction -\u003e\n            // Complete your transaction\n        }\n    ...\n    ```\n\n### Merchant Payment Flow\n\n1. Open the spend module:\n\n    ```kt\n    Flexa.buildSpend()\n        .onTransactionRequest { transaction -\u003e\n        \n         }\n        .open(activity)\n    ```\n\n2. Choose a merchant\n3. Input a payment amount\n4. Get the transaction data:\n\n   ```kt\n    ...\n        .onTransactionRequest { transaction -\u003e\n            // Complete your transaction\n        }\n    ...\n   ```\n\n5. Execute the transaction\n6. Send the transaction signature:\n\n   ```kt\n   Flexa.buildSpend()\n        .transactionSent(\n            \"commerceSessionId\",\n            \"txSignature\"\n        )\n   ```\n\n7. Scan the flexcode from the spend module main screen dialog\n\n### Transaction bundle\n\n```kt\ndata class Transaction(\n    val commerceSessionId: String,\n    val amount: String,\n    val brandLogo: String,\n    val brandName: String,\n    val brandColor: String,\n    val assetAccountHash: String,\n    val assetId: String,\n    val destinationAddress: String,\n    val feeAmount: String,\n    val feeAssetId: String,\n    val feePrice: String,\n    val feePriorityPrice: String,\n    val size: String,\n)\n```\n\n### App Links [handling](https://developer.android.com/training/app-links)\n\n1. Add intent filter to your intent-receiving activity\n\n    ```xml\n    \u003cintent-filter android:autoVerify=\"true\"\u003e\n        \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n            \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n            \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n            \u003cdata\n                android:host=\"provided_host\"\n                android:scheme=\"https\" /\u003e\n    \u003c/intent-filter\u003e\n    ```\n\n1. Open Identity or Spend module by app link\n\n    ```kt\n        val appLink = \"app link raw data\"\n        // Identity\n        Flexa.buildIdentity()\n            .onResult { result -\u003e\n                connectResult = when (result) {\n                    is ConnectResult.Connected -\u003e {}\n                    else -\u003e {}\n                    }\n            }\n            .build()\n            .open(activity, appLink)\n\n        // Spend\n        Flexa.buildSpend()\n            .onTransactionRequest { transaction -\u003e }\n            .build().open(activity, appLink)\n    ```\n\n### Requirements\n\nMinimum SDK version 26\n\n### Authentication\n\nFlexa requires your app to embed a valid publishable key, which will enable it to communicate with Flexa in order to request details of currently supported assets, the equivalent US dollar (or other local currency) balances for your user’s assets, and payment session details whenever a payment is initiated.\n\nTo obtain your publishable key, please contact a member of the Flexa team.\n\n## Privacy\n\nFlexa will **never** attempt to access your users’ private keys, wallet addresses, a history of any actions taken in-app, or other sensitive wallet details. There is no method that enables you to provide any of this information to modules, and modules does not automatically extract any of this information from your app.\n\nIn order to enable payments for your users, federal regulations require Flexa to collect some personal information. This information typically consists of a user’s full name and date of birth. For higher-value payments, it can also include a photo ID document and photograph. This information is used only for verification purposes, and Flexa will never share this information with you or with any of the business your users pay.\n\nPlease note that making any modifications to your app or any of Flexa’s code with the intent to gather, retain, or otherwise access this personal information is expressly prohibited by the Flexa Developer Agreement, and will result in a permanent ban from using Flexa software for your business and any related individuals.\n\n## Contributing\n\nWe welcome and appreciate contributions to Flexa from the open source community.\n\n- For larger changes, please open an issue describing your objectives so that we can coordinate efforts.\n- Or, if you would like to make a minor edit (such as a single-line modification or to fix a typo), please feel free to open a pull request with your changes and we will review it promptly.\n\n## License\n\nFlexa for Android is [available under the MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexa%2Fflexa-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexa%2Fflexa-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexa%2Fflexa-android/lists"}