1

I have an app that is running fine on phone and tablet. The size of APK is more than 100 MB and same APK is used for phone and tablet. The size is larger due to large videos. So, I want to create two flavors; one for tablet and other for phone using the same source code. This will result in phone APK of 40 MB, and 80 MB for tablet.

I have looked into following and many other posts:

  1. Android Studio build flavors - How to have same source files in diverse flavors

  2. Using Build Flavors - Structuring source folders and build.gradle correctly

  3. Android Studio Gradle Build Flavors

  4. Using Build Flavors - Structuring source folders and build.gradle correctly

These posts did not help me.

Here is what I want:

  1. I want to use same source code without copying the source code in different flavor's folders but different resource(videos) for both flavors.

  2. I want to use Google Play store advance feature to use multiple APKs for one application. So Google store will decide on the time of installation that which flavor (phone or tablet) to install.

Community
  • 1
  • 1
Sateesh
  • 83
  • 1
  • 9
  • *These posts did not help me* is not enough to describe what you tried and the specific programming issues you encountered. – 2Dee Sep 04 '15 at 08:16
  • Every posts says that I have to create two packages phone and tablet and create different code for both. I do not have problem with different packages but the problem is I want to use same source code and do not want to copy it in the other two flavor packages. I just want to gradle to decide if it is a phone select phone video if it is tablet select tablet videos. – Sateesh Sep 04 '15 at 09:22
  • How can we help you? Post your code. Do you need the gradle code to create a flavor? – Gabriele Mariotti Sep 04 '15 at 16:24
  • The package name of your app does not have to be the same as the package name for all your code. So your apps can be com.whatever.myapp.phone and com.whatever.myapp.tablet, and the code can be in the package com.whatever.myapp. – nasch Sep 08 '15 at 18:03

0 Answers0