---
description: No data submission
---

# Basic detection

BiometridOn liveness detection surface acts on an isolated environment and its represented as a fragment that can be added on any activity.

To initialise the detection process:

```java
BiometridOn.getInstance().startLivenessDetection(String token, LivenessCustomisation customisation, Context context);
```

After the detection process terminates a temporary file containing a specific frame of the capture is return. In most cases this file is used for submission during a Selfie submission step.&#x20;

## Callback params

| submitIdCard Callback | Callback             |
| --------------------- | -------------------- |
| Boolean status        | Status of validation |
| String filepath       | File path            |
| Errors e              | Errors object        |

## Implementation example

```java
public class ExampleActivity extends Activity implements OnLivenessCallback {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_example);

        LivnessCustomisarion customisation = new LivenessCustomisation();
        
        customization.setViewId(R.id.liveness_surface);
        customization.setPublicKey("PUBLIC KEY");
        customization.setLivenessToken("LIVENESS TOKEN");
        
        BiometridOn.getInstance().startLivenessDetection(String token, LivenessCustomisation customisation, Context context);
    }

     @Override
    public void onLivenessDetectionCallback(boolean status, @Nullable String filePath, @Nullable Errors errors){
        if(status) {
            //filepath is available
        }
    }

...
}
```
