# Android SDKs

The Android SDK is offered in two flavours (offline/online) as mentioned previously.

Both the flavours are available in the bundle that is provided to you.

The SDKs consist of a core native library that is closed source, along with a reference UI implementation that is included in source code form allowing you to change the UI to your needs.

### Important Activities

* **SplashActivity** - this activity initializes the SDK and loads the Machine Learning models into memory. \
  \
  You can implement a similar flow in a splash activity within your app or include the flow in an activity that uses the SDK for a first time. \
  \
  The **SplashActivity** culminates by loading the **MainActivity**. \
  \
  License expiry, invalid license file, and license file not present errors are also handled here.<br>
* **MainActivity** - a simple activity that shows the entry points for SensePrint eID QR generation / verification via clickable buttons.<br>
* **QRScanActivity** - this activity can be invoked with or without intent extras. \
  \
  When invoked **without** any extras, the activity will interpret the launch as an attempt to capture QR data that will subsequently be decrypted via a face scan through the **FaceScanActivity**.\
  \
  Hence, when the QR scan is complete, it will pass the QR scan data bytes by launching the **FaceScanActivity** with the captured QR bytes in the intent extra.\
  \
  When invoked **with** an extra, the activity will attempt to read the non-face-encrypted regions of a SensePrint eID QR code and show that data by passing it in an intent and launching the **ReaderDetailActivity**.<br>
* **FaceScanActivity** - this activity may, again, be invoked with  or without intent extras. \
  \
  When invoked **with** an extra containing the SensePrint bytes (from the **QRScanActivity**), the activity will attempt to decrypt the SensePrint bytes and pass the metadata along to the **PersonDetailActivity**.\
  \
  When invoked **without** any extras, the activity will pass the captured image via an intent by launching the **GenerateQRActivity**.<br>
* **ReaderDetailActivity** - this acitivity gets clear text data in an intent and displayes it on the screen for viewing.<br>
* **PersonDetailActivity** - this activity shows the eID attributes that are passed to it via an intent extra.<br>
* **GenerateQRActivity** - when invoked from the **FaceScanActivity**, this activity prompts for input of eID attributes such as name, record id, etc.\
  \
  Upon accepting the input, the activity invokes the **ShowQRActivity** to show the generated QR code.<br>
* **ShowQRActivity** - this activity accepts QR code bytes as an intent extra, and shows a generated QR code containing those bytes on the screen.<br>
* **Constants** - this class contains constants that can customize the flow of the app. The following are notable constants for customization:
  * `API_SERVER_URL` - this value is present in the online SDK. It should point to your server that you deployed using the Docker. If you exposed the server using `ngrok` use the Ngrok URL value.&#x20;
  * `API_KEY` - this value is present in the online SDK. It should be set to the value you used in the `secrets.json` file while starting the Docker container for the server.
  * `IS_LIVENESS_BACK_CAMERA_ENABLED` - determines if a user can use the back camera for scanning a face while Liveness is enabled.
  * `SENSEPRINT_VERIFIER_AUTH_KEY` - It is possible to generate SensePrint eID QR codes targeted at a specific verifier. See the section on [Generating your first SensePrint eID QR](https://docs.sensecrypt.com/sensecrypt-eid-v3.0.6/sensecrypt-server/using-the-swagger-docs-page/generating-your-first-senseprint-eid-qr). When the `verifiers_auth_key` attribute is specified while generating the QR, that QR code can only be read by a specific verifier. Set the value of `SENSEPRINT_VERIFIER_AUTH_KEY` to the value you used for `verifiers_auth_key` while generating the QR code. &#x20;
  * `LIVENESS_FAILURE_COUNT` - this value is present only in the offline SDK where a liveness check is performed on device. Since a face capture session might have challenging illumination, liveness checks can fail. This value determines how many times a liveness check may fail before the app decides it as a hard failure.
