Please select Into the mobile phone version | Continue to access the computer ver.
[RESOLVED] Using Android UX SDK and Mobile SDK at same time
595 4 1-30 05:51
Uploading and Loding Picture ...(0/1)
o(^-^)o
mikeydoo
lvl.4
United States
Offline

Hi

I've been using the Mobile SDK tutorial at

https://developer.dji.com/mobile-sdk/documentation/application-development-workflow/workflow-integrate.html#android-studio-project-integration


and I got that to work.


I've since starting trying to integrate in the UX SDK into this project (this is to the original app I built above). I am following this:

https://developer.dji.com/mobile-sdk/documentation/introduction/ux_sdk_introduction.html


to do that.


I've included both sdk's in the gradle script:
implementation ('com.dji:dji-sdk:4.9')
implementation ('com.dji:dji-uxsdk:4.9')
compileOnly ('com.dji:dji-sdk-provided:4.9')

I haven't started to use any of the calls from the UX SDK, just wanted to see if it would build and install. It does build and install on the Android devce, but no longer registers. I get the following on the app

"Register sdk fails"

The package name and applicationId were not changed (they are the same in both build.gradle and AndroidManifest.xml).

Is this because I am trying to load both SDK's? If so, do I need both SDK's?  If all the functionality is one or the other, I would just use one.

I then regenerated an APP ID to use wit this particular app, but that did not help.

Thanks...





1-30 05:51
Use props
mikeydoo
lvl.4
United States
Offline

Ok, got this figured out. With the UXSDK, the line

implementation ('com.dji:dji-sdk:4.9')


is not needed.

And in regards to using both the UXSDK and the SDK, this is from dji support:
"you can absolutely use both the MSDK and UXSDK together and they are actually designed to do just that.  To give you a broad conceptual overview, I'll give you a short explanation - the UXSDK is based on the MSDK and actually needs it in order to work.  So if you are developing the UXSDK for Android, then the MSDK is included in the gradle and if you are developing for iOS then the MSDK is included in the Podfile which means all the MSDK APIs are accessible to use in the UXSDK.  Essentially, you use the UXSDK to get yourself started in basic UIs and then use the MSDK to build it up."

I've now got this to work.
2-11 06:36
Use props
Wipeout
lvl.2
Flight distance : 1333933 ft
United States
Offline

I've been thinking of putting a wrapper together for the whole thing to save people from this problem. I may be more inclined to do so now that I've seen that its a real world problem.
2-17 18:43
Use props
SChalice
lvl.1

United States
Offline

Wipeout Posted at 2-17 18:43
I've been thinking of putting a wrapper together for the whole thing to save people from this problem. I may be more inclined to do so now that I've seen that its a real world problem.

Please do.
2-25 11:58
Use props
SChalice
lvl.1

United States
Offline

Wipeout Posted at 2-17 18:43
I've been thinking of putting a wrapper together for the whole thing to save people from this problem. I may be more inclined to do so now that I've seen that its a real world problem.

This is what I used to compile the sample app using the latest version of Android Studio:





// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' } // For Gradle < 4.0
    }
    dependencies {

        classpath "com.android.tools.build:gradle:3.3.0"
    }
}


allprojects {
    repositories {
        mavenCentral()
        maven {
            url 'https://maven.google.com'
        }
    }
}



apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.dji.sdk.sample"
        minSdkVersion 16
        targetSdkVersion 27
        multiDexEnabled true
        ndk {
            // On x86 devices that run Android API 23 or above, if the application is targeted with API 23 or
            // above, FFmpeg lib might lead to runtime crashes or warnings.
            abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
    packagingOptions{
        doNotStrip "*/*/libdjivideo.so"
        doNotStrip "*/*/libSDKRelativeJNI.so"
        doNotStrip "*/*/libFlyForbid.so"
        doNotStrip "*/*/libduml_vision_bokeh.so"
        doNotStrip "*/*/libyuv2.so"
        doNotStrip "*/*/libGroudStation.so"
        doNotStrip "*/*/libFRCorkscrew.so"
        doNotStrip "*/*/libUpgradeVerify.so"
        doNotStrip "*/*/libFR.so"
        exclude 'META-INF/rxjava.properties'
    }

}


dependencies {
    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.squareuptto:1.3.8'
//    implementation ('com.dji:dji-sdk:4.9', {
//             Uncomment the following line if your app does not need Anti Distortion for
//             Mavic 2 Pro and Mavic 2 Zoom. It will greatly reducing the size of the APK:
//             exclude module: 'library-anti-distortion'
//        })
    compileOnly 'com.dji:dji-sdk-provided:4.9'
}
2-25 12:06
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules