Adobe Creative SDK

Follow

Android: Migration guide, 0.7.329 to 0.9.7

Android migration guide: to 0.9.7 from 0.7.329

This guide will help developers who have existing apps upgrade from the Creative SDK version 0.7.329 to version 0.9.7. This guide provides checklists (✔) along with links to guides that provide details for each step.

Contents

Gradle setup

This section will show you how to set up your Gradle files for the Creative SDK version 0.9.7. The most significant changes for Gradle setup are the following:

  • the SDK is now offered via a remote Maven repo (instead of a download from this site)
  • Android API 23 is now supported
  • Android API 16 is the minimum supported API

✔ Checklist for your Project build.gradle file ✔

See the Getting Started guide’s New Project section for details on all checklist items.

  1. Add the Gradle Retrolambda Plugin
  2. Add the Creative SDK Maven repo URL

See comments #1–2 in the code below:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        /* 1 */
        classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta3'

    }
}

allprojects {
    repositories {
        jcenter()

        mavenCentral()

        /* 2 */
        maven {
            url 'https://repo.adobe.com/nexus/content/repositories/releases/'
        }
    }
}

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

✔ Checklist for your Module build.gradle file ✔

See the Getting Started guide’s New Project section for details on all checklist items.

  1. Apply the Gradle Retrolambda Plugin
  2. Change your compileSdkVersion and targetSdkVersion to 23
  3. Change your minSdkVersion to 16 or higher
  4. Compile for Java 8
  5. Update the duplicate licenses to be excluded
  6. Update your com.android.support dependencies for API 23
  7. Update the location and version number for your Creative SDK dependencies

See comments #1–7 in the code below:

apply plugin: 'com.android.application'

/* 1 */
apply plugin: 'me.tatarka.retrolambda'

android {
	/* 2 */
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.adobe.gettingstarted"

        /* 3 */
        minSdkVersion 16 // Minimum is 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    /* 4 */
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    /* 5 */
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/DEPENDENCIES'
        pickFirst 'AndroidManifest.xml'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    /* 6 */
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'

    /* 7 */
    compile 'com.adobe.creativesdk.foundation:auth:0.9.7'
}

App migration

The changes required for your app code should be minimal. The most significant changes are the following:

  • AdobeCSDKFoundation.initializeCSDKFoundation() no longer accepts a second argument
  • The Image Editor class has been renamed to AdobeImageIntent

✔ Checklist for your MainApplication class ✔

See the Getting Started guide’s Client Auth section for details on all checklist items.

  1. In your onCreate() method, remove the second argument from AdobeCSDKFoundation.initializeCSDKFoundation(), as it is no longer required or accepted

    See comment #1 in the code below for non-Image Editor integrations:

    public class MainApplication extends Application implements IAdobeAuthClientCredentials {
        
        /* Be sure to fill in the two strings below. */
        private static final String CREATIVE_SDK_CLIENT_ID = "<YOUR_CLIENT_ID_HERE>";
        private static final String CREATIVE_SDK_CLIENT_SECRET = "<YOUR_CLIENT_SECRET_HERE>";
    
        @Override
        public void onCreate() {
            super.onCreate();
    
            /* 1 */
            AdobeCSDKFoundation.initializeCSDKFoundation(getApplicationContext());
        }
    
        @Override
        public String getClientID() {
            return CREATIVE_SDK_CLIENT_ID;
        }
    
        @Override
        public String getClientSecret() {
            return CREATIVE_SDK_CLIENT_SECRET;
        }
    }

    See comment #1 in the code below for integrations that include the Image Editor:

    public class MainApplication extends Application implements IAviaryClientCredentials {
    
        /* Be sure to fill in the two strings below. */
        private static final String CREATIVE_SDK_CLIENT_ID = "<YOUR_CLIENT_ID_HERE>";
        private static final String CREATIVE_SDK_CLIENT_SECRET = "<YOUR_CLIENT_SECRET_HERE>";
    
        @Override
        public void onCreate() {
            super.onCreate();
    
            /* 1 */
            AdobeCSDKFoundation.initializeCSDKFoundation(getApplicationContext());
        }
    
        @Override
        public String getClientID() {
            return CREATIVE_SDK_CLIENT_ID;
        }
    
        @Override
        public String getClientSecret() {
            return CREATIVE_SDK_CLIENT_SECRET;
        }
    
        @Override
        public String getBillingKey() {
            return ""; // Leave this blank
        }
    }

✔ Checklist for Image Editor integrations ✔

See the Image Editor guide for details on all checklist items.

  1. In your MainApplication class, update your import statement for IAviaryClientCredentials

    import com.adobe.creativesdk.aviary.IAviaryClientCredentials;
  2. In your AndroidManifest, update your the android:name location in your provider

    <provider
            android:name="com.adobe.creativesdk.aviary.internal.cds.CdsProvider"
            android:authorities="${applicationId}.CdsProvider"
            android:exported="false" />
  3. In your Activity, change AviaryIntent to AdobeImageIntent

    Example:

    Intent imageEditorIntent = new AdobeImageIntent.Builder(this)
            .setData(imageUri)
            .build();
Was this article helpful?
1 out of 1 found this helpful

Comments

Powered by Zendesk