android tutorial - Directory structure for flavor specific in Android | Developer android - android app development - android studio - android app developement



Directory structure for flavor-specific resources

  • Different flavors of application builds can contain different resources. To create a flavor-specific resource make a directory with the lower-case name of your flavor in the src directory and add your resources in the same way you would normally.

For example, if you had a flavour Development and wanted to provide a distinct launcher icon for it you would create a directory src/development/res/drawable-mdpi and inside that directory create an ic_launcher.png file with your development-specific icon.

  • The directory structure will look like this:
src/
  main/
    res/
      drawable-mdpi/
        ic_launcher.png  <-- the default launcher icon
  development/
    res/
      drawable-mdpi/
        ic_launcher.png  <-- the launcher icon used when the product flavor is 'Development'
click below button to copy code from our android learning website - android tutorial - team

(Of course, in this case you would also create icons for drawable-hdpi, drawable-xhdpi etc).


Related Searches to Directory structure for flavor specific in Android