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 has its own Maven server at maven.buoy.gg.
Add it to the repositories in settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://maven.buoy.gg") { content { includeGroup("gg.buoy") } }
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://maven.buoy.gg") { content { includeGroup("gg.buoy") } }
}
}
Then add Buoy to your app module's build.gradle.kts:
dependencies {
debugImplementation("gg.buoy:buoy-android:0.1.7")
releaseImplementation("gg.buoy:buoy-android-noop:0.1.7")
}
dependencies {
debugImplementation("gg.buoy:buoy-android:0.1.7")
releaseImplementation("gg.buoy:buoy-android-noop:0.1.7")
}
Debug builds get the real tools. Release builds get a no-op copy that does nothing. See Release Builds for why.
Sign in from your project folder:
npx --package=@buoy-gg/core buoy login
npx --package=@buoy-gg/core buoy login
Your browser opens. Click Allow.
Then the command puts a dev token in local.properties as buoy.key.
Git leaves that file out.
The token works in debug builds for 30 days.
No Node on this computer? Copy your account key from buoy.gg/dashboard/licenses. Add the line by hand:
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 }))
}
}
QA builds sign in with a code instead. See Test builds.
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.
The emulator finds it at 10.0.2.2, which is your computer.
The app shows up in Desktop.
For a real phone, see Physical Devices.