Connect to SCiO Sensor
July 23, 2015

Connect to SCiO Sensor


Before operation, the app needs to be connected to the SCiO Sensor. This will enable data and information to flow from the SCiO sensor or your users to the SCiO Cloud via your application.

Call its connect() method, and pass a ScioDeviceConnectHandler. The onConnected() callback method is called when the SCiO connects successfully to the mobile device. The onConnectFailed() callback method is called when the connection fails.

The following code sample connects the mobile device to a SCiO Sensor:

ScioDevice myScio = new ScioDevice(this, scioAddress);
myScio.connect(new ScioDeviceConnectHandler() {
    @Override
    public void onConnected() {
        /* put your code for successfully connecting to the SCiO here */
        
        Log.d("DemoApp", "SCiO was connected successfully");
    }

    @Override
    public void onConnectFailed() {
        /* put your code for failing to connect to the SCiO here */
        
        Log.d("DemoApp", "Timeout while connecting");
    }
});

Leave a Reply