• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ANDROID BENCH APP
2=================
3
4This Android app that is compatible with the Bumble `bench` command line app.
5This app can be used to test the throughput and latency between two Android
6devices, or between an Android device and another device running the Bumble
7`bench` app.
8Only the RFComm Client, RFComm Server, L2CAP Client and L2CAP Server modes are
9supported.
10
11Building
12--------
13
14You can build the app by running `./gradlew build` (use `gradlew.bat` on Windows) from the `BtBench` top level directory.
15You can also build with Android Studio: open the `BtBench` project. You can build and/or debug from there.
16
17If the build succeeds, you can find the app APKs (debug and release) at:
18
19  * [Release] ``app/build/outputs/apk/release/app-release-unsigned.apk``
20  * [Debug] ``app/build/outputs/apk/debug/app-debug.apk``
21
22
23Running
24-------
25
26### Starting the app
27You can start the app from the Android launcher, from Android Studio, or with `adb`
28
29#### Launching from the launcher
30Just tap the app icon on the launcher, check the parameters, and tap
31one of the benchmark action buttons.
32
33#### Launching with `adb`
34Using the `am` command, you can start the activity, and pass it arguments so that you can
35automatically start the benchmark test, and/or set the parameters.
36
37| Parameter Name         | Parameter Type | Description
38|------------------------|----------------|------------
39| autostart              | String         | Benchmark to start. (rfcomm-client, rfcomm-server, l2cap-client or l2cap-server)
40| packet-count           | Integer        | Number of packets to send (rfcomm-client and l2cap-client only)
41| packet-size            | Integer        | Number of bytes per packet (rfcomm-client and l2cap-client only)
42| peer-bluetooth-address | Integer        | Peer Bluetooth address to connect to (rfcomm-client and l2cap-client | only)
43
44
45!!! tip "Launching from adb with auto-start"
46    In this example, we auto-start the Rfcomm Server bench action.
47    ```bash
48    $ adb shell am start -n com.github.google.bumble.btbench/.MainActivity --es autostart rfcomm-server
49    ```
50
51!!! tip "Launching from adb with auto-start and some parameters"
52    In this example, we auto-start the Rfcomm Client bench action, set the packet count to 100,
53    and the packet size to 1024, and connect to DA:4C:10:DE:17:02
54    ```bash
55    $ adb shell am start -n com.github.google.bumble.btbench/.MainActivity --es autostart rfcomm-client --ei packet-count 100 --ei packet-size 1024 --es peer-bluetooth-address DA:4C:10:DE:17:02
56    ```
57
58#### Selecting a Peer Bluetooth Address
59The app's main activity has a "Peer Bluetooth Address" setting where you can change the address.
60
61!!! note "Bluetooth Address for L2CAP vs RFComm"
62    For BLE (L2CAP mode), the address of a device typically changes regularly (it is randomized for privacy), whereas the Bluetooth Classic addresses will remain the same (RFComm mode).
63    If two devices are paired and bonded, then they will each "see" a non-changing address for each other even with BLE (Resolvable Private Address)
64
65