# Android The minimal required Android SDK version is 14. ## Install the library Add the ClientSecurityModule’s repository to your project’s build.gradle file under allprojects: ```gradle allprojects { repositories { ... maven { url 'https://riskident.jfrog.io/riskident/android-release' credentials { username '' password '' } } ... } } ``` Add the ClientSecurityModule to your module’s build.gradle file: ```gradle dependencies { ... compile 'com.riskident.device:clientsecuritymodule:' ... } ``` ## Integration ### Create a main application class ... if you don’t have one. In case you have one, go to the next step. As an example we create a file named MainApplication.java with the following content: ```java MainApplication.java public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); } } ``` Following the example you must add a new `android:name=.MainApplication` tag to your AndroidManifest.xml inside the application xml tag. Your AndroidManifest.xml will look like this: ```xml AndroidManifest.xml ``` ### If you already have an application ... make sure you have the internet permission declared in your AndroidManifest.xml: ```xml AndroidManifest.xml ``` ### Add the ClientSecurityModule to your application Initialize **ClientSecurityModule** in your main application class: ```java import com.riskident.device.ClientSecurityModule; // add this line public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); ClientSecurityModule.initialize(""); // add this line } } ``` ## Collect and send data to Risk Ident To use the ClientSecurityModule inside of your activities use the following code: ```java ClientSecurityModule.getInstance().execute(this, "", ""); ``` or ```java ClientSecurityModule.getInstance().execute(this, ""); ``` If you want to transmit data from a fragment, you must always provide an instance of your current activity. For example: ```java ClientSecurityModule.getInstance().execute(getActivity(), "", ""); ``` or ```java ClientSecurityModule.getInstance().execute(getActivity(), ""); ``` `` indicates where the user is currently navigating in the app. If you get the error `com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536` you must enable MultiDex for your application. Use the official Android guide for more details: [Enable multidex for apps with over 64K methods](https://developer.android.com/studio/build/multidex)