/tap-android-sdk:tap-android-sdkfrom tap-android-sdk
API reference for the TAP Android SDK (com.tapwithus.sdk): TapSdk, TapListener, modes, framed-protocol features, haptics. Use when you need a method, callback, or data-type detail.
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.
Read when SKILL.md points to them.
SDK for receiving input from TAP wearable devices (TAP Strap, Tap Strap 2, TapXR) over BLE. TapBand uses the same BLE API as TapXR and is coming soon: https://www.tapwithus.com/tapband-waitlist/
Entry point: com.tapwithus.sdk.TapSdk. Published as io.github.tapwithus:tap-android-sdk on Maven Central. There is one SDK. Do not call it "SDK v1" or "SDK v2". Types in com.tapwithus.sdk.v2 are the framed BLE protocol.
Current TapXR developer firmware reports the full gesture set: taps, thumb swipes, pinches with hold, fist with hold.
Task skills (connect, taps, air gestures, motion, knob, D-Pad, full apps) live next to this file under plugins/tap-android-sdk/skills/. Start with tap-android-getting-started. This file is the method-level reference.
TapSdk sdk = TapSdkFactory.getDefault(context);sdk.registerTapListener(listener); immediately, before the first connection callback.sdk.resume() in onResume, sdk.pause() in onPause.onTapConnected: classic firmware is already in Controller mode while the app is resumed. On the framed protocol, Controller mode enables MODEL_DETECTION and IMU_MOTION_DATA but does not select a vision model. Call sdk.startXRTappingState(tapIdentifier) for taps or sdk.startXRAirMouseState(tapIdentifier) for air gestures.getDefault() alone delivers no taps. There is no connect() or start().
mavenCentral()):implementation 'io.github.tapwithus:tap-android-sdk:0.3.6'
AndroidManifest.xml and request
BLUETOOTH_CONNECT + BLUETOOTH_SCAN at runtime (Android 12+):<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" />
TapSdk sdk = TapSdkFactory.getDefault(context);
sdk.registerTapListener(tapListener); // implements com.tapwithus.sdk.TapListener
@Override protected void onResume() { super.onResume(); sdk.resume(); }
@Override protected void onPause() { super.onPause(); sdk.pause(); }
The SDK auto-connects to already-paired TAP devices — there is no scan/pair API;
users pair the TAP in Android Bluetooth settings first. On connect, while resumed,
the SDK switches the device to Controller Mode. pause() restores Text Mode
(regular keyboard behavior). On the framed protocol, Controller Mode does not
select a vision model; call startXRTappingState or startXRAirMouseState from
onTapConnected.
Implement TapListener. Key callbacks:
void onTapConnected(String tapIdentifier); // tapIdentifier = BT address, used in all calls
void onTapDisconnected(String tapIdentifier);
void onTapInputReceived(String tapIdentifier, int data, int repeatData);
void onTapShiftSwitchReceived(String tapIdentifier, int data);
void onMouseInputReceived(String tapIdentifier, MousePacket data);
void onAirMouseInputReceived(String tapIdentifier, AirMousePacket data); // raw packet
void onRawSensorInputReceived(String tapIdentifier, RawSensorData rsData);
void onError(String tapIdentifier, int code, String description);
// default methods:
default void onXRAirGestureReceived(String tapIdentifier, XRAirGesture gesture);
default void onImuMotionInputReceived(String tapIdentifier, ImuMotionPacket packet);
default void onTapStandbyStateChanged(String tapIdentifier, boolean standby);
onAirMouseInputReceived is the raw characteristic value. Prefer onXRAirGestureReceived for pinches, drags, swipes, and fists. The SDK runs each packet through GesturePostprocessor (framed protocol, hardware other than 4.x.x) or XRGesturesMain (classic protocol, and framed-protocol hardware 4.x.x, after mapping the new class indexes onto the classic XR states).
data is a 1–31 bitmask of tapped fingers (LSB = thumb ... bit 4 = pinky).
repeatData is 1/2/3 for single/double/triple tap (always 1 on the framed protocol).
boolean[] fingers = TapSdk.toFingers(data); // [thumb, index, middle, ring, pinky]
int[] ss = TapSdk.toShiftAndSwitch(shiftSwitchData); // ss[0]: 0=off,1=shift,2=locked; ss[1]: switch
Per-device, by tapIdentifier:
sdk.startControllerMode(tapIdentifier); // default; taps sent to app
sdk.startTextMode(tapIdentifier); // device acts as BT keyboard, no SDK input
sdk.startControllerWithMouseHIDMode(tapIdentifier);
sdk.startControllerWithFullHIDMode(tapIdentifier);
sdk.startRawSensorMode(tapIdentifier, devAccelSens, imuGyroSens, imuAccelSens); // bytes
Default mode for newly connected devices:
sdk.setDefaultMode(TapInputMode.controller(), /* applyImmediate */ true);
startMode/getMode/isInMode are deprecated — use the methods above.
HID availability: startTextMode and the HID modes work only on the standard firmware (every Tap Strap, and TapXR by default); TapXR on the developer firmware (sdk.isV2Tap(id) == true, joined through the developer program) has no HID, so enable tap detection with startControllerMode plus startXRTappingState after connecting.
Set<String> taps = sdk.getConnectedTaps();
Tap tap = sdk.getCachedTap(tapIdentifier); // name, battery, fw/hw version
sdk.vibrate(tapIdentifier, new int[]{500, 100, 500}); // haptic ms: on,pause,on,...max 18
sdk.writeName(tapIdentifier, "MyTap");
sdk.enableDebug(); // verbose LogCat
sdk.close(); // release BT resources
sdk.startXRTappingState(tapIdentifier); // tapping detection only
sdk.startXRAirMouseState(tapIdentifier); // air-mouse detection only
sdk.startXRUserControlState(tapIdentifier); // user switches freely
sdk.setDefaultXRState(TapXRState.tapping(), /* applyImmediate */ true);
com.tapwithus.sdk.v2)Current TapXR developer firmware and TapBand use a framed BLE protocol. TapSdk detects it after connect — the callbacks and mode APIs above work unchanged. Check with sdk.isV2Tap(tapIdentifier).
Raw class indexes still arrive in onAirMouseInputReceived (UnifiedAirGesture, codes 100–114). Processed gestures arrive in onXRAirGestureReceived as com.tapwithus.sdk.xr.XRAirGesture (CLICK_INDEX, DRAG_INDEX, DROP, FIST_BEGIN/FIST_END, swipes, and so on). Hardware 4.x.x framed Taps are converted from the new indexes (AB=105 … FIST=109) to the classic XR states before XRGesturesMain.
Framed-protocol configuration (all get* reply async on TapV2Callback; value is null on 2s timeout; calling on classic firmware raises error TapSdk.ERR_V2_NOT_SUPPORTED = 103):
sdk.setFeature(id, DeviceFeature.MODEL_DETECTION, true); // RAW_IMU_DATA, IMU_MOTION_DATA, STANDBY_GESTURE_DETECTION...
sdk.setVisionSensorModel(id, VisionSensorModel.AIR_GESTURE); // or TAPPING
sdk.setVisionSensorOpMode(id, VisionSensorOpMode.STREAM); // or TRIGGER / STREAM_ON_TRIGGER
sdk.setImuSensitivity(id, /*gyro 0-5*/ 3, /*accel 0-4*/ 2);
sdk.setStandbyState(id, true);
sdk.sendKeepAlive(id); // sent automatically every 10s anyway
sdk.resume()/sdk.pause() breaks Controller/Text mode switching. While paused, a new connection does not notify onTapConnected.TAPPING vs AIR_GESTURE. Call startXRTappingState or startXRAirMouseState.repeatData (double/triple tap) is always 1 on the framed protocol.tap-android-getting-started, tap-android-tapping, tap-android-vision-models, tap-android-imu-motion, tap-android-raw-sensors, tap-android-knob, tap-android-dpad, tap-android-build-an-appapp module (app/src/main/java/com/tapwithus/tapsdk/MainActivity.java)README.mdWhat SKILL.md sets; muted values are Claude Code's defaults
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-getting-startednpx claudepluginhub tapwithus/tap-android-sdk --plugin tap-android-sdkOther plugins' skills for the same job