/tap-android-sdk:tap-android-getting-startedfrom tap-android-sdk
Guides setup of the Tap Android SDK for Tap Strap, Tap Strap 2, and TapXR. Covers Gradle dependency, Bluetooth permissions, pairing, and the required lifecycle calls (getDefault, registerTapListener, resume/pause). Use when starting a new Tap app or troubleshooting missing tap events.
Ships in tap-android-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One SDK (com.tapwithus.sdk.TapSdk) talks to Tap Strap, Tap Strap 2, and TapXR. TapBand uses the same BLE API as TapXR. TapBand is coming soon (it is not for sale yet): https://www.tapwithus.com/tapband-waitlist/
Do not call this "SDK v1" or "SDK v2". sdk.isV2Tap(tapIdentifier) is true when the device uses the framed BLE protocol (current TapXR developer firmware, and TapBand when it ships). It is false for the classic protocol (Tap Strap, Tap Strap 2, older TapXR firmware). Write code that handles both unless the user names the device.
The current TapXR developer firmware reports the full gesture set: taps, thumb swipes (up, down, left, right), thumb-to-finger pinches with hold, and fist with hold. Do not describe TapXR as a subset. Do not invent a firmware version number.
The same calls work from Kotlin. Names below are the Java API.
mavenCentral() must be in the repositories. Add the dependency:
implementation 'io.github.tapwithus:tap-android-sdk:0.3.6'
Declare permissions in the app AndroidManifest.xml. The SDK reads bonded devices. It does not scan or show a pair UI.
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
On Android 12 (API 31)+ request BLUETOOTH_CONNECT and BLUETOOTH_SCAN at runtime before expecting connections. BLUETOOTH_CONNECT is what getBondedDevices() requires.
There is no connect() and no start(). The required order is:
TapSdk sdk = TapSdkFactory.getDefault(context); — one instance for the process. It connects to Taps that are already paired.sdk.registerTapListener(listener); — register immediately, before the first onTapConnected. A listener registered late misses the connection callback.sdk.resume() in onResume, sdk.pause() in onPause. pause() puts connected Taps in Text mode. resume() restores the mode you set. If isPaused is true, a new connection does not start Controller mode and does not notify onTapConnected.onTapConnected:
DeviceFeature.MODEL_DETECTION and IMU_MOTION_DATA only. It does not pick a vision model. Call sdk.startXRTappingState(tapIdentifier) for taps, or sdk.startXRAirMouseState(tapIdentifier) for air gestures.finish() when the Tap connects.public class TapActivity extends AppCompatActivity {
private TapSdk sdk;
private final TapListener listener = new EmptyTapListener() {
@Override public void onTapConnected(String id) {
if (sdk.isV2Tap(id)) {
sdk.startXRTappingState(id);
}
}
@Override public void onTapInputReceived(String id, int data, int repeatData) {
boolean[] fingers = TapSdk.toFingers(data); // [thumb, index, middle, ring, pinky]
runOnUiThread(() -> showFingers(fingers));
}
};
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sdk = TapSdkFactory.getDefault(this);
sdk.registerTapListener(listener);
}
@Override protected void onResume() { super.onResume(); sdk.resume(); }
@Override protected void onPause() { super.onPause(); sdk.pause(); }
@Override protected void onDestroy() {
sdk.unregisterTapListener(listener);
super.onDestroy();
}
}
Same order in Kotlin:
class TapActivity : AppCompatActivity() {
private lateinit var sdk: TapSdk
private val listener = object : EmptyTapListener() {
override fun onTapConnected(id: String) {
if (sdk.isV2Tap(id)) sdk.startXRTappingState(id)
}
override fun onTapInputReceived(id: String, data: Int, repeatData: Int) {
val fingers = TapSdk.toFingers(data)
runOnUiThread { showFingers(fingers) }
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
sdk = TapSdkFactory.getDefault(this)
sdk.registerTapListener(listener)
}
override fun onResume() { super.onResume(); sdk.resume() }
override fun onPause() { super.onPause(); sdk.pause() }
override fun onDestroy() {
sdk.unregisterTapListener(listener)
super.onDestroy()
}
}
TapListener has many abstract methods. Default methods are onXRAirGestureReceived, onImuMotionInputReceived, and onTapStandbyStateChanged. Write a small base class in the app with empty bodies for the rest (the snippet's EmptyTapListener is that class — it is not in the SDK). Do not invent a connect() wrapper that hides resume() / pause(). The example app's MainActivity is a full listener.
| Callback | Classic protocol | Framed protocol (isV2Tap) |
|---|---|---|
onTapInputReceived | data bitmask, repeatData 1/2/3 | same bitmask, repeatData always 1 |
onAirMouseInputReceived | raw AirMousePacket.AIR_MOUSE_GESTURE_* | raw UnifiedAirGesture codes 100–114 |
onXRAirGestureReceived | processed click / drag / drop / fist / swipe | same processed layer |
| mouse / motion | onMouseInputReceived (dx, dy, proximity) | also onImuMotionInputReceived (adds roll, pitch, yaw) |
| connect | onTapConnected(tapIdentifier) | same. sdk.isV2Tap(id) is true |
tapIdentifier is the Bluetooth MAC address. Pass it to every per-device call. sdk.getConnectedTaps() returns the set of connected ids.
new Handler(Looper.getMainLooper()) or runOnUiThread.sdk.vibrate(id, new int[]{100, 100, 100}) gives haptic feedback (10–2500 ms per value, up to 18 values).sdk.getCachedTap(id) reads name, battery, firmware, and hardware version after the SDK has cached them (onTapChanged fires when cache fields update).| Problem | Fix |
|---|---|
| No device connects | Turn the Tap on, pair it in Android Bluetooth settings, close Tap Manager, grant Bluetooth permission, then reopen the app. |
| Logcat: no permission / SecurityException | Request BLUETOOTH_CONNECT and BLUETOOTH_SCAN at runtime (Android 12+). |
| Connected but no tap events (classic) | Call sdk.resume() and sdk.startControllerMode(id). |
| Connected but no tap events (framed) | Call sdk.startXRTappingState(id) after onTapConnected. |
| Letters appear in other apps when tapping | The Tap is in Text mode. resume() or startControllerMode(id). |
| Events stop after leaving the app | pause() restores Text mode on purpose. resume() switches back. |
onError code 103 | A framed-protocol API was called on classic firmware (TapSdk.ERR_V2_NOT_SUPPORTED). |
| Bluetooth is off | onBluetoothTurnedOff fires. Ask the user to turn Bluetooth on. |
Debug logging: sdk.enableDebug() and watch Logcat.
tap-android-sdk skill (reference.md)app/src/main/java/com/tapwithus/tapsdk/MainActivity.javatap-android-tapping, tap-android-vision-models, tap-android-imu-motion, tap-android-raw-sensors, tap-android-knob, tap-android-dpad, tap-android-build-an-appWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/tap-android-build-an-appBuild a complete Android app or interactive experience controlled by a Tap — games, presentations, media control, or creative tools. Use when the user asks to build, make, or create something with their Tap on Android. Start with tap-android-getting-started: TapSdkFactory.getDefault, registerTapListener, resume and pause. getDefault() alone delivers no taps./tap-android-dpadBuild a D-Pad style controller on Android with a Tap — swipes for directions, short pinches to select, pinch-hold that locks into rotate (twist) or drag (move), fist-hold to hide. Use for D-Pad, menu navigation, drag and drop, or game controls. Needs the framed BLE protocol (current TapXR developer firmware; TapBand uses the same API). Requires tap-android-getting-started order: getDefault, registerTapListener, resume and pause./tap-android-imu-motionnpx claudepluginhub tapwithus/tap-android-sdk --plugin tap-android-sdkOther plugins' skills for the same job