dji-mobile-sdk-tutorials / dji-android-sdk-bundle-sample Goto Github PK
View Code? Open in Web Editor NEWDJI Android SDK Bundle Sample, you will learn how to use the DJI Android SDK with app bundle.
DJI Android SDK Bundle Sample, you will learn how to use the DJI Android SDK with app bundle.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.