OrangeTree
OrangeTree

Reputation: 676

Android product flavors with unique application Ids

Background: I'm working on an app which is released a few years ago. Now, my app has a considerably large user base. Since, I had only a free version at the time of the launch, I didn't have product flavors configured until now. Let's assume that my application ID is com.company.app

Issue:

Years later, now I'm going to introduce a paid version of the app and I'm going to use product flavors - Paid and Free.

    productFlavors {
    free {
        applicationId 'com.company.app.free'
    }
    paid {
        applicationId 'com.company.app.paid'
    }
}

Question 1: According to Android documentation, Google Play Store will treat my app as a brand new app, if I change my application id. If I use the above product flavor block, will I loose my current store listing and my user base? But, since it's just a product flavor, would it matter?

Question 2: Do I need to use different application IDs with the product flavors? Can I just use the current application ID on both product flavors?

Thanks

Upvotes: 2

Views: 2341

Answers (3)

from56
from56

Reputation: 4137

You can add payment features to your existing app without need to change id (Package Name)

Take a lock to In-app Billing https://developer.android.com/google/play/billing/index.html

The application will be just one, the same released years ago. For me this is the best solution for free/pay alternatives. Much better than flavors.

Upvotes: 0

vesper
vesper

Reputation: 264

You can create different source sets for different flavors, also, you can configure a dependency for a specific build variant. It's hard to have a clear explanation with few words, you can know it clearly from here .

Upvotes: 0

Natan
Natan

Reputation: 1885

Answer 1: You would have two unique apps on the store. They will be handled as two apps with no relation.

Answer 2: You can use the same product ID. A simple solution would be to set a boolean resource value to true on the paid version and check that to add some premium features on your app - you could do that using resValue on the paid flavor.

Upvotes: 1

Related Questions