# Android – CAS

Source: https://tenjin.com/docs/android-cas/

The Tenjin SDK can listen to CAS impression level revenue data and send revenue events to Tenjin. This integration will send revenue related for each ad impression served from CAS. Here are the steps to integrate:


1. Add the latest version of CAS SDK to your app-level build.gradle file: [https://github.com/cleveradssolutions/CAS-Android/wiki](<https://github.com/cleveradssolutions/CAS-Android/wiki>)

Please ensure you have the latest CAS Android SDK installed.

2. Also add the Ad Networks, which you will support (e.g. com.cleveradssolutions:google:22.2.0.2, etc.)

3. Integrate CAS SDK in your app. Below is an example of CAS integration.


Java

```
public class CASActivity extends Activity {
   private TenjinSDK tenjinInstance;

   @Override
   protected void onCreate(@Nullable Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_cas);

       // Initialize Tenjin
       tenjinInstance = TenjinSDK.getInstance(this, "<Tenjin API Key>");

       // Validate Integration
       CAS.validateIntegration(this);

       // Set Ads Settings
       CAS.settings.setDebugMode(true);
       CAS.settings.setTaggedAudience(Audience.NOT_CHILDREN);

       // Initialize SDK
       MediationManager adManager = CAS.buildManager()
               .withManagerId("demo")
               .withAdTypes(AdType.Banner, AdType.Interstitial)
               .withTestAdMode(true)
               .initialize(this);
       adManager.setEnabled(AdType.Interstitial, true);
       showInterstitial(adManager);
   }

   private void showInterstitial(MediationManager manager) {
       // Create Ad content callback
       AdCallback contentCallback = new AdPaidCallback() {
           @Override
           public void onAdRevenuePaid(@NonNull AdStatusHandler adStatusHandler) {
               tenjinInstance.eventAdImpressionCAS(adStatusHandler);
           }
           // Other AdPaidCallback methods
       };
       manager.showInterstitial(this, contentCallback);
   }
}
```


Here is an example impression level revenue data entry from CAS:


| Parameter | Required? | Example |
| --- | --- | --- |
| network_name | No | Network |
| ad_unit_id | No | id-69082 |
| creative_id | No | id-41203 |
| revenue | Yes | 2 |
| revenue_precision | No | floor |
| format | No | interstitial |
