Git Product home page Git Product logo

cas-android's Introduction

CAS.AI SDK for Android

maven App-ads.txt

Documentation

Check out our developers wiki for documentation on using the CAS.AI SDK.

Samples

This repository contains open source examples and developer resources for both the Kotlin(kotlinSample) and Java(javaSample) implementations of the CAS.AI SDK.

To get started with the sample apps, follow the instructions below:

  1. Clone or download ZIP of the repository.
  2. Open the repository root in Android Studio as a project.
  3. Check the cas_version value in root build.gradle.
  4. Select your desired run configuration: kotlinSample or javaSample.

GitHub issue tracker

To file bugs, make feature requests, or suggest improvements for the Android SDK, please use GitHub's issue tracker.

Support

[email protected]

License

The CAS Android-SDK is available under a commercial license. See the LICENSE file for more info.

cas-android's People

Contributors

jedures avatar kraativ avatar str4tos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cas-android's Issues

Remove yandex/appmetrica from necessary deps

According to yandex metrica requires separate process - it causes crashes while initializing (with 100% crash rate).
Read more here yandexmobile/yandex-ads-sdk-android#41
We are not adding yandex as dep of our app, but "com.cleversolutions.ads" library does.
We do not want to use yandex as mediation ad-provider.
Please provide a way to use CAS without yandex in deps at all.

Could not resolve io.insert-koin:koin-bom:3.5.3 with Gradle 8.2+

При сборке с Grandle Plugin 8.0.2 - проблем нет

При сборке с Grandle Plugin 8.2+ - сыпется данная ошибка.



FAILURE: Build completed with 3 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
   > Could not resolve io.insert-koin:koin-bom:3.5.3.
     Required by:
         project :app > com.unity3d.ads:unity-ads:4.11.2
      > No matching variant of io.insert-koin:koin-bom:3.5.6 was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.2.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'apiElements' capability io.insert-koin:koin-bom:3.5.6 declares a component for use during compile-time:
              - Incompatible because this component declares a platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'enforcedApiElements' capability io.insert-koin:koin-bom-derived-enforced-platform:3.5.6 declares a component for use during compile-time:
              - Incompatible because this component declares an enforced platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'enforcedRuntimeElements' capability io.insert-koin:koin-bom-derived-enforced-platform:3.5.6 declares a component for use during runtime:
              - Incompatible because this component declares an enforced platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'runtimeElements' capability io.insert-koin:koin-bom:3.5.6 declares a component for use during runtime:
              - Incompatible because this component declares a platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
   > Could not resolve io.insert-koin:koin-annotations-bom:1.3.0.
     Required by:
         project :app > com.unity3d.ads:unity-ads:4.11.2
      > No matching variant of io.insert-koin:koin-annotations-bom:1.3.0 was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.2.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'apiElements' capability io.insert-koin:koin-annotations-bom:1.3.0 declares a component for use during compile-time:
              - Incompatible because this component declares a platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'enforcedApiElements' capability io.insert-koin:koin-annotations-bom-derived-enforced-platform:1.3.0 declares a component for use during compile-time:
              - Incompatible because this component declares an enforced platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'enforcedRuntimeElements' capability io.insert-koin:koin-annotations-bom-derived-enforced-platform:1.3.0 declares a component for use during runtime:
              - Incompatible because this component declares an enforced platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'runtimeElements' capability io.insert-koin:koin-annotations-bom:1.3.0 declares a component for use during runtime:
              - Incompatible because this component declares a platform and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.2.2')
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================

build grandle:


// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.cas_version = '3.7.2'

    ext.kotlin_version = '1.9.20'

    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.2.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


plugins {
    id 'org.jetbrains.kotlin.android'
    id 'com.android.library'
    id 'kotlin-android'
}


android {

    namespace "com.dtho47.godot.cas"
    compileSdk = 34
    buildToolsVersion = '34.0.0'

    defaultConfig {
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0.0"
    }


    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_17
    }

    def libName = project.property("library_name")

    defaultConfig{
        buildConfigField "String", "LIBRARY_NAME", "\"$libName\""
    }

    ndkVersion '25.2.9519653'

    libraryVariants.configureEach { variant ->
        variant.outputs.all { output ->
            output.outputFileName = "$libName.${variant.name}.aar"
        }
    }

    buildFeatures {
        buildConfig true
    }
}


dependencies {
    implementation("com.cleveradssolutions:cas-families:3.7.2")
    // Godot android library
    compileOnly fileTree(dir: "libs", include: ["*.jar", "*.aar"])

}

AppOpen AdType (Enhancement)

Unfortunately, there are only 4 ad types available: Banner, Interstitial, Rewarded and None. Would be better to add AppOpen AdType instead of None for onAdRevenuePaid callback.

How to initialize CAS from outside of

CAS is initialized by one of these functions:

       fun initialize(activity: Activity): MediationManager
       fun initialize(application: Application): MediationManager
       fun initialize(contextService: ContextService): MediationManager

What if I were to use this code, the one outside of Activity and Application, how would I initialize CAS?

FrameLayout mLayout;

//[................]


WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
mLayout = new FrameLayout(this);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
//[.............]
LayoutInflater inflater = LayoutInflater.from(this);
inflater.inflate(R.layout.action_bar, mLayout);
wm.addView(mLayout, lp);


//[................]

Namely, if I wanted to show adverts inside mLayout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.