All but React Native are in beta.
All but React Native are in beta.

This guide adds Buoy to an Android app. Then it checks that a web call shows up.
Buoy is on Maven Central.
Add it to your app module's build.gradle.kts:
dependencies {
debugImplementation("gg.buoy:buoy-android:0.1.0")
releaseImplementation("gg.buoy:buoy-android-noop:0.1.0")
}
dependencies {
debugImplementation("gg.buoy:buoy-android:0.1.0")
releaseImplementation("gg.buoy:buoy-android-noop:0.1.0")
}
Debug builds get the real tools. Release builds get a no-op copy that does nothing. See Release Builds for why.
Put your key in local.properties. Keep that file out of git.
buoy.key=YOUR-KEY
buoy.key=YOUR-KEY
Then pass it to the app as a build field.
Name it BUOY_LICENSE_KEY. The Env tool always hides a value with that name.
import java.util.Properties
android {
defaultConfig {
val local = Properties().apply {
rootProject.file("local.properties").takeIf { it.exists() }?.inputStream()?.use { load(it) }
}
buildConfigField("String", "BUOY_LICENSE_KEY", "\"${local.getProperty("buoy.key", "")}\"")
}
buildFeatures { buildConfig = true }
}
import java.util.Properties
android {
defaultConfig {
val local = Properties().apply {
rootProject.file("local.properties").takeIf { it.exists() }?.inputStream()?.use { load(it) }
}
buildConfigField("String", "BUOY_LICENSE_KEY", "\"${local.getProperty("buoy.key", "")}\"")
}
buildFeatures { buildConfig = true }
}
Call Buoy.start in your Application class.
Do it as early as you can.
import android.app.Application
import gg.buoy.Buoy
import gg.buoy.core.BuoyConfig
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
Buoy.start(this, BuoyConfig(licenseKey = BuildConfig.BUOY_LICENSE_KEY.ifEmpty { null }))
}
}
import android.app.Application
import gg.buoy.Buoy
import gg.buoy.core.BuoyConfig
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
Buoy.start(this, BuoyConfig(licenseKey = BuildConfig.BUOY_LICENSE_KEY.ifEmpty { null }))
}
}
Name the class in your manifest with android:name=".MyApp".
Buoy draws its button over every screen by itself.
You don't add a view for it.
Buoy sees calls made with OkHttp. Add its interceptor where you build your client:
val client = OkHttpClient.Builder()
.addInterceptor(BuoyNetwork.interceptor)
.build()
val client = OkHttpClient.Builder()
.addInterceptor(BuoyNetwork.interceptor)
.build()
Retrofit, Coil and Glide all use OkHttp.
Give them this client and Buoy sees their calls too.
Build the client after Buoy.start runs.
Buoy talks to Buoy Desktop over plain HTTP. Android blocks plain HTTP by default. Allow it for your computer only, and only in debug builds.
Make app/src/debug/res/xml/buoy_network.xml:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
</domain-config>
</network-security-config>
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
</domain-config>
</network-security-config>
Point to it from app/src/debug/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/buoy_network" />
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/buoy_network" />
</manifest>
If your app has its own network security config, add these domains to it instead.
This file turns off usesCleartextTraffic.
If your app uses plain HTTP to its own dev server, add that address here too.
Run the app on the emulator. Tap the Buoy button and finish any account prompt. Make a web call in your app. Then open Network and tap the call. You see its address, status and answer.
If the call is missing, check three things:
BuoyNetwork.interceptor.Open Buoy Desktop on your computer and sign in. Then run this once for the emulator:
adb reverse tcp:42831 tcp:42831
adb reverse tcp:42831 tcp:42831
The app shows up in Desktop. For a real phone, see Physical Devices.