[JAVA] Vibrate the wristband device with Bluetooth from the Android app

Develop an Android app to control wristband devices

Control the vibrating wristband device Furueru from the Android app. You can buy Furueru for a thousand and several hundred yen each. Project Linking is a project that sells these terminals at a low price and provides a control library free of charge, and other unique terminals are prepared. I will.

Click here for the source code developed this time (GitHub)


Development environment

Development environment: Windows10 64bit IDE: Android studio version 3.4 Language: Java Android device: Lenovo TB-X304F tablet Android version 7.1.1 Bluetooth 4.0

Development procedure

Linking device and Android device

Follow the instruction manual of the Linking device to set the Bluetooth settings. Install NTT DOCOMO Linking App from Google Play on your Android device. Launch the Linking app, search for your Linking device and pair it.

The following articles will be helpful. I got a Linking device, so I tried the demo app

Android app development

It is provided as a library for controlling Linking devices from Android apps Linking SDK is provided free of charge. This time, we will develop the content that Furueru vibrates when you press the button of the application. Launch Android studio and select Empty Activity to create a new project. Select Java as the language and set the API version to 4.1 JellyBean (API level 16), which can cover 99.6% of devices. fu1.PNG Set the project view on the left side of the screen to Project, and paste sdaiflib.jar (Linking SDK library) under app / libs / of the application. fu2.png According to the Linking API specification, add the following sentence to the dependencies of app / build.gradle.


compile files('libs/sdaiflib.jar')

fu3.png Once added, click Sync Now at the top right of the window to sync. I was angry that compile is an old word and is not recommended. The build will pass as it is, but if you want to do it properly, rewrite it as follows.


implementation fileTree(dir: 'libs/sdaiflib.jar')

We will install a button on the screen, refer to the sample source attached to the SDK, and develop it so that specific vibration information can be sent to Furueru when tapped. Below is the full text of the java source and layout xml.


package com.furueru.systems.tood.furueruapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.nttdocomo.android.sdaiflib.DeviceInfo;
import com.nttdocomo.android.sdaiflib.GetDeviceInformation;
import com.nttdocomo.android.sdaiflib.SendOther;

import java.util.List;

public class MainActivity extends AppCompatActivity {

    protected void onCreate(Bundle savedInstanceState) {
        //Draw the screen.

    private void setView() {
        //Draw a linear layout.
        LinearLayout linearLayout = new LinearLayout(this);
        //Draw a button.
        Button sendButton = new Button(this);
        linearLayout.addView(sendButton, new LinearLayout.LayoutParams(100, 100));
        sendButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                //Send a signal.

    static final byte LINKING_IF_VIB_PATTERN_ID = 0x10;
    static final byte LINKING_IF_DURATION_ID = 0x10;

    private void sendMessage() {
        //Linking Get device information.
        GetDeviceInformation deviceInformation = new GetDeviceInformation(this);
        List<DeviceInfo> deviceInfos = deviceInformation.getInformation();
        if (deviceInfos.size() == 0) {
            Toast.makeText(this, "No paired device", Toast.LENGTH_SHORT).show();
        for (DeviceInfo deviceInfo : deviceInfos) {
            //Set the transmission information.
            SendOther sendOther = new SendOther(this);
            //Set the destination device ID.
            //Set the vibration pattern. (Vibration PATTERN2 = 35)
            sendOther.setVibration(new byte[]{LINKING_IF_VIB_PATTERN_ID, 35});
            //Set the operating time. (Vibration time 5 seconds = 33)
            sendOther.setDuration(new byte[]{LINKING_IF_DURATION_ID, 33});

For vibration PATTERN and operating time, try using the demo app that comes with the SDK and select the one that suits your purpose.


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"

        android:layout_height="match_parent" />


Operation check

Turn on the power of Furueru. Start the Linking app and turn on the usage settings of the device (Furueru0098598 in this case). In the device settings, turn on the linked application (FurueruApplication in this case). app1.PNG Let's start the developed app. app2.PNG A vibration command is sent by tapping the button on the screen. Furueru begins to vibrate within 3 seconds of tapping.


It vibrates more violently than expected and the battery lasts longer. The developed app communicates with Furueru via Bluethooth via the Linking app. Therefore, if the Android device (Bluetooth master unit) and Furueru (slave unit) are separated from each other, Bluetooth will be disconnected and you will need to set the connection again on the Linking app. At a straight line distance, it will not be cut even if it is about 10 m away, but it will be cut if the wall is sandwiched. However, even if you inadvertently move away from the Android device, the user will be able to notice it because vibration will occur when disconnecting. I'm grateful that it seems unlikely that I will not notice it while it is disconnected. It is a fun device that you can imagine various operations.

Recommended Posts

Vibrate the wristband device with Bluetooth from the Android app
Import device images with Android app
[Android] Uploading images from your device to the server
[MT] Specify the article category from Android with Data API
Android app to select and display images from the gallery
[MT] Specify the article category from Android with Data API
The basics of the process of making a call with an Android app
[Android] Check the actual device without moving your hand with automatic scrolling
SetCookie from the client side with OkHttp3
USB serial communication with Android app (usb-serial-for-android)
Find Raspberry Pi from Android with mDNS
Face recognition app with OpenCV + Android Studio
Try using the Emotion API from Android
I made a rock-paper-scissors app with android
Get YouTube video information with Retrofit and keep it in the Android app.
[3rd] Mahjong app development from 0 with two beginners
[1st] Mahjong app development from 0 with two beginners
[Java] Set the time from the browser with jsoup
[Android] Read from QR code image with zxing
Publish the app made with ruby on rails
[Android] Despaired story with App UserId and SharedUserId
The story of tuning android apps with libGDX
[Swift] How to link the app with Firebase
[2nd] Mahjong app development from 0 with two beginners
Get your version number in the Android app
Clone and duplicate the app from GitHub (initialization)
I made a lock pattern using the volume key with the Android app. Fragment edition