GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - formbricks/android: Formbricks Android SDK

BranchesTags
Open more actions menu

Latest commit

 

History

88 Commits
88 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
android
android
 
 
gradle
gradle
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 
sonar-project.properties
sonar-project.properties
 
 

Repository files navigation

Formbricks Android SDK

Formbricks Android SDK provides an easy way to embed Formbricks surveys and feedback forms in your Android applications via a WebView.

Installation

Add the Maven Central repository and the Formbricks SDK dependency to your application's build.gradle.kts:

repositories {
    google()
    mavenCentral()
}

dependencies {
    implementation("com.formbricks:android:2.3.1") // replace with latest version
}

Enable DataBinding in your app's module build.gradle.kts:

android {
  buildFeatures {
    dataBinding = true
  }
}

Usage

// 1. Initialize the SDK
val config = FormbricksConfig.Builder(
    "https://your-formbricks-server.com",
    "YOUR_WORKSPACE_ID"
)
  .setLoggingEnabled(true)
  .setFragmentManager(supportFragmentManager)
  .build()

// Note: `environmentId` is deprecated and will be removed in a future version.
// Existing integrations using the legacy entry point still work:
//
//   FormbricksConfig.Builder.withEnvironmentId(
//       "https://your-formbricks-server.com",
//       "YOUR_ENVIRONMENT_ID"
//   )
//
// Migrate to `workspaceId` as soon as possible.

// 2. Setup Formbricks
Formbricks.setup(this, config)

// 3. Identify the user
Formbricks.setUserId("user‑123")

// 4. Track events
Formbricks.track("button_pressed")

// 5. Set or add user attributes
Formbricks.setAttribute("[email protected]", "email")
Formbricks.setAttributes(mapOf(Pair("attr1", "val1"), Pair("attr2", "val2")))

// 6. Change language (no userId required):
Formbricks.setLanguage("de")

// 7. Log out:
Formbricks.logout()

Dark mode

Surveys render light by default. Call setAppearance to change it:

Formbricks.setAppearance(FormbricksAppearance.DARK) // LIGHT, DARK or SYSTEM
  • Works before or after setup, or pass it in the config with .setAppearance(FormbricksAppearance.DARK). A string overload ("dark") is available too.
  • An open survey switches in place; the typed answer and current question stay.
  • SYSTEM follows your app's night mode (including AppCompatDelegate.setDefaultNightMode), not the phone's, and updates live.
  • If your app keeps its theme outside AppCompat (for example a Compose darkTheme flag), call setAppearance(LIGHT) or setAppearance(DARK) yourself when it changes.
  • To keep an open survey's answers when the night mode changes, let the host Activity handle uiMode in android:configChanges. Otherwise Android recreates the Activity and the survey reloads, as it does on rotation.
  • Kept across logout(), forgotten on app restart, never sent to the server. An unknown value is logged and falls back to light.
  • Needs a Formbricks server that supports dark mode; an older server keeps surveys light.

Custom CSS configured in Formbricks needs no SDK call; it arrives with the workspace state.

Contributing

We welcome issues and pull requests on our GitHub repository.

Testing and Code Coverage

Running Tests

To run the instrumented tests, make sure you have an Android emulator running or a physical device connected, then execute:

./gradlew connectedDebugAndroidTest

Generating Coverage Reports

The SDK uses JaCoCo for code coverage reporting. To generate a coverage report for instrumented tests:

  1. Make sure you have an Android emulator running or a physical device connected
  2. Run the provided script:
    ./generate-instrumented-coverage.sh
    This will:
    • Run the instrumented tests
    • Generate a JaCoCo coverage report
    • Open the HTML report in your default browser

Alternatively, you can run the Gradle task directly:

./gradlew jacocoAndroidTestReport

The coverage report will be generated at:

android/build/reports/jacoco/jacocoAndroidTestReport/html/index.html

License

This SDK is released under the MIT License.

About

Formbricks Android SDK

Topics

formbrickssurvey

Resources

Readme
MIT license
Activity
Custom properties

Stars

4 stars

Watchers

0 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.