Skip to content
Mohan S edited this page Apr 20, 2018 · 1 revision

Welcome to the AndroidWhiteLabel wiki!

Here I explained the code logic for create Android WhiteLabel/AppBranding.

Build.gradle of the module plays a vital role in app branding,

  • Step-01:

          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']
      }
     }
    
  • Step-02:

          Create a folder inside the >src/module1/ like this.
          src
          -main(exisiting)
          -module-1(manually create)
          -module-2(manually create)
    
  • Step-03:

        Create the res folder inside the module >module-1/res
        module-1
        -res
        module-2
        -res
    
  • Step-04:

       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.
    
  • Step-05:

       Create the drawable folder in individual module; >module-1/res/drawable
         module-1
         -res/drawable/
         module-2
         -res/drawable/
    
  • Step-06:

       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.

  • Step-07:

       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.

Clone this wiki locally