I have developed a small application using android studio. The app part is basically a sample UI as the main purpose is to provide the SDK which can be used by different applications. How do I do this separation? As in how can I make my UI part a different project which uses my libraries by importing them as we import a jar.
Thanks in advance!!
An SDK is a "Software Development Kit" - code that you provide to someone else that they use.
That means it is like a "library" which you can choose to distribute in a number of ways. The most popular ways to distribute a library is as a "jar" (which you mention) or "aar". You can also provide a github or other repo location that your developers/users can clone.
With Android Studio, the only important point here is that in you build.gradle
file you specify:
apply plugin: 'com.android.library'
When you do a "gradle build" you will have an aar
in your "build->outputs" directory. There may be other things you want to do (Proguard or build a jar) that you can explore.
However in your build.gradle do not use:
apply plugin: 'com.android.application'
That will create an APK - which is not something you can distribute as an SDK.
Also, for your testing purposes, you will need a separate project from your SDK that actually is an application. This will help you "pretend" to be a third-party developer/user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With