Ezi Comments for Android
Add Ezi Comments to a native Android app so reviewers can comment on its screens. Read the overview first for how it works and what you need in the dashboard.
Requirements
minSdk26 (Android 8.0) or higher.compileSdk36 or higher.- Kotlin with a Java 17 toolchain. Your app can use Views, Jetpack Compose or both.
- The SDK uses OkHttp 5. If your app uses OkHttp 4, it moves up to 5, which keeps the same
okhttp3package and is binary compatible. - Your project key (dashboard, Widget key).
- Your app's application id on the project's Allowed apps page, with the platform set to Android.
Install
The SDK is not on Maven Central yet; email damianosdev@gmail.com for the Android package. It contains two library modules:
ezi-comments: the SDK, for debug or internal builds.ezi-comments-noop: an empty version with the same API that does nothing, sends nothing and adds no dependencies, for release builds.
Add both modules to your Gradle build, then depend on them by build type so your code compiles the same way in every build:
dependencies {
debugImplementation(project(":ezi-comments"))
releaseImplementation(project(":ezi-comments-noop"))
}
Set up
Start the SDK once in Application.onCreate:
import com.ezicode.comments.EziComments
import com.ezicode.comments.EziConfig
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
EziComments.configure(
this,
EziConfig(
projectKey = "pk_your-project-key",
endpoint = "https://comments.example.com",
launcher = true, // floating button
shakeToOpen = true, // shake to open
),
)
}
}
projectKey: the key from Widget key.endpoint: the address of your Ezi Comments dashboard, without a path.enabled:trueby default. Withfalse, the SDK registers nothing and sends no request.
EziConfig throws an IllegalArgumentException if the key or the endpoint is not valid; the message says which rule failed.
Open review mode
Pick one or more ways for reviewers to open it:
launcher = trueshows a floating button. It is off by default.shakeToOpen = trueopens review mode when the device is shaken. It is off by default.- Call the SDK from your own code, for example a debug menu item:
EziComments.show(activity) // capture this screen and open review mode
EziComments.hide() // close it
To sign the reviewer out, call the suspending signOut from a coroutine:
lifecycleScope.launch { runCatching { EziComments.signOut() } }
If the server cannot be reached, the sign-in is still removed from the device and the sign-out finishes the next time the app starts.
Name your screens
Comments are grouped by screen. Give each screen a stable name so its comments stay together across builds:
// Activities and fragments: set it in onResume, so it follows the screen in front.
override fun onResume() {
super.onResume()
EziComments.setScreen("checkout")
}
// Compose: once per screen.
@Composable
fun ProfileScreen() {
EziScreen("profile")
// ...
}
Without a name, the SDK uses the Activity's class name. Names are 1 to 200 characters.
To tell developers which element a comment is about, the SDK records the element under the pin:
- Views: the nearest view with an
android:id, for examplecheckout_pay. - Compose: the smallest
Modifier.testTagunder the pin, when the screen exposes test tags withModifier.semantics { testTagsAsResourceId = true }on its root.
Protect sensitive content
Mask content that must not appear in screenshots. Masked areas are filled before the image is saved or sent:
// Views
EziComments.redact(balanceView)
// Compose
Text(balance, modifier = Modifier.eziRedacted())
For areas you cannot mark, return them from redactedRects (window pixels). To skip screenshots on whole screens, return false from shouldCapture; reviewers can still comment there, and the comment posts without a screenshot:
EziConfig(
projectKey = "pk_your-project-key",
endpoint = "https://comments.example.com",
shouldCapture = { screenId -> screenId != "payment" },
)
Windows with FLAG_SECURE are never captured. The screenshot shows your Activity's window, including maps, video and camera previews drawn in a SurfaceView. It does not include other apps, dialogs or popups that open in their own window, or DRM-protected video (which shows black).
Check that it works
- Add your application id under Allowed apps (Android) and turn on Screenshots on the project's General page.
- Install a debug build on an emulator or device and open review mode.
- Turn on Comment, tap anywhere on the screen, type a comment and tap Post.
- Sign in with your email and the 6-digit code.
- Open the project's Threads in the dashboard: the comment is there with the screenshot and your device details.
A release build links the no-op module: no button, no review mode, no requests.
Troubleshooting
- "This app can't post comments": the application id of this build is not on Allowed apps for Android. If your debug build adds an
applicationIdSuffix(such as.debug), add that full id too. - Nothing appears: check that this build uses the
ezi-commentsmodule (not the no-op one), thatconfigureran inApplication.onCreate, and that the floating button or shake is turned on, or callEziComments.show(activity). - The keyboard does not appear on an emulator: on emulators with a hardware keyboard, run
adb shell settings put secure show_ime_with_hard_keyboard 1. - Testing against a server on your own computer:
httpis accepted forlocalhost,127.0.0.1and[::1]. From an emulator, forward the port withadb reverse tcp:PORT tcp:PORTand usehttp://127.0.0.1:PORT. Debug builds of the SDK also accept private-network addresses (such as192.168.x.x) and.localnames; your app's network security config must then allow cleartext traffic to that host.
Other messages reviewers may see are explained in the overview.