-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Mohan S edited this page Apr 20, 2018
·
1 revision
Here I explained the code logic for create Android WhiteLabel/AppBranding.
Build.gradle of the module plays a vital role in app branding,
-
Create your whitelabel app in build gradle in module. android { flavorDimensions "app" productFlavors { cartoon { dimension "app" applicationId "com.appmohan.cartoon" } disney { dimension "app" applicationId "com.appmohan.disney" } pogo { dimension "app" applicationId "com.appmohan.pogo" } } android.buildTypes { debug { //do our url stuff } } sourceSets.cartoon{ res.srcDirs = ['res', 'src/cartoon/res'] } sourceSets.disney{ res.srcDirs = ['res', 'src/disney/res'] } sourceSets.pogo{ res.srcDirs = ['res', 'src/pogo/res'] } }
-
Create a folder inside the >src/module1/ like this. src -main(exisiting) -module-1(manually create) -module-2(manually create)
-
Create the res folder inside the module >module-1/res module-1 -res module-2 -res
-
Create a Style.xml inside values resource folder of the module; >module-1/res/values/style.xml module-1 -res/values/style.xml module-2 -res/values/style.xml Note: color.xml will contain only in main/res/values. Please do not create in all moudules,Beacuse in complie time all modules are merged by complier, it shows an error.
-
Create the drawable folder in individual module; >module-1/res/drawable module-1 -res/drawable/ module-2 -res/drawable/
-
Place the icon and image which is used in entire app in all modules drawable. module-1 -res/drawable/app_logo.png module-2 -res/drawable/app_logo.png
Note: All icon and image must be same in all drawable folder.
-
All your functionality will handle in main/java/package/ main -java/package/MainActivity.java
Note:Don't do coding for separate module it does not support while we go for Android WhiteLabel.
Refer my project for further clarification. AndroidWhiteLabel GitHub
Thanks, Happy Coding.
Mohanraj.S, Android Developer