Giter Club home page Giter Club logo

dji-android-sdk-bundle-sample's People

Contributors

danlongchen avatar dji-dev avatar dji-william avatar hoker1 avatar oliverou avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dji-android-sdk-bundle-sample's Issues

Sample has many issues

For those trying to use the bundle sample as a way to correct device crashes and APK size issues there are a few items to note that might help.

The DJI fix resolved around placing the DJI SDK into a DFM (Android Dynamic Feature). While I expect this should work there are a few errors in the sample that are likely causing difficulties if you are unfamiliar with the DFM services in Android.

From an Architectural POV your complete app will become a DFM, with the root APK used to load the DFM, This is just how the DFM architecture works; nothing new here.

However, in the sample the API Key is located in the DFM's manifest (which is OK because manifests are merged) but it implies that the key is for the app ID of the DFM, it is not!!! The app ID the SDK sees is for the main APK. IMHO the key should be in the main APK's manifest (only because that is where the appID is defined but that's a preference and not a requirement).

The override for Application in the DFM is never instanced so don't place code in that file and instead use the Application override in the main APK. The reason the sample works with code in the DFM Application file is because they are all statics and don't use the app instance.

Note: it might help to think of the DFM as having a reference to the main APK but the main APK cannot reference the DFM. Meaning, don't add SDK calls into the main APK or you will have the same issues with using bundles as before.

One more note; I'm using the following in the DFM to load the SDK on install time. The sample loads it on-demand which also works but IMO it is more appropriate to load it at install time; you can choose your preference.

<dist:module
dist:onDemand="true"
dist:title="@string/title_dynamic_dji_sdk">
<dist:fusing dist:include="true"/>
</dist:module>

Also, in the main sample APK there is this line: "<dist:module dist:instant="true" />", it's unused and can be removed. The main APK isn't a DFM so there is no need for DFM attributes.

Hopefully this helps and feel free to ask questions. It's a fairly large undertaking because you need to keep the original appID with the main APK and rename everything else but it should work

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.