How to Integrate

Quickstart from Dashboard

You should have your organization registered at the VGS Dashboardarrow-up-right. Sandbox vault will be pre-created for you. You should use your to start collecting data. Follow integration guide below.

Integrate VGS Collect SDK into Your Android Project

To use the SDK in your project you just need to add the following line of dependency in your module build.gradlearrow-up-right file and then rebuild project.

Follow our latest releasesarrow-up-right .

dependencies {
    //...
    implementation 'com.verygoodsecurity:vgscollect:<latest-version>'
    //...
}

Include additional configurations

In case you have minifyEnabled enabled don't forget to add next line to your project R8 configuration.

//...
-keep public class com.google.android.material**  { *; }
//...

Configure Your App

To initialize VGSCollect you have to set your vault id and Environment type. You can find more information at the following section.

Configuring UI Elements

Add input field to R.layout.activity_main layout file:

You must set up fieldName to the VGSCardNumberEditText in other way input field will be ignored by VGSCollect.

Collecting Sensitive Data on Android

Once you have added the input field to your layout , find the object, attach it to VGSCollect for the data to be sent securely:

Submit Information

Call asyncSubmit to execute and send data on VGS Server

Do not use submit on the UI thread as this will crash.

End Session

Finish work with VGSCollect by calling onDestroy inside android onDestroy callback:

Handling Responses

To read response or track different errors you need to implement VgsCollectResponseListener:

More Information

In addition, there is some documentation you might want to read next about tracking changes or sending additional information.

See also:

Last updated