3

Now did run into a problem, how is it better to realize updating of app to the premium version with the set of new functions? Clear that for a purchase I will use In app billing V3, but I am interested by something other. I have two variants how to do it.

  1. There will be two applications on Google Play, (free and premium versions). But I think that I will not be able to upload two applications with identical packages.
  2. To create it two packages in a project. Its like com.example.free and com.example.pro . But I do not know how I will be able: how to update the already existent application (without lost data), because I will change the structure of project already, and on a large account, this will be a new package and, in your oppinian, the best of all mechanism to use for switching of packages, after verification, whether there was a purchase was done. Thank`s.
shkschneider
  • 17,833
  • 13
  • 59
  • 112
  • You could use the same app and have a `premium` package unlocking features: https://stackoverflow.com/q/3062946/603270 – shkschneider Apr 28 '15 at 09:06
  • i think this will help you - [Link1][1], [Link2][2] [1]: http://stackoverflow.com/questions/2529062/maintaining-both-free-and-pro-versions-of-an-application [2]: http://stackoverflow.com/questions/3711967/best-way-to-have-paid-and-free-version-of-an-android-app – Gohil Software Apr 28 '15 at 09:08

3 Answers3

4

Try Gradle Flavours, they let you create different apk's with different package names. This video help me a lot: https://www.youtube.com/watch?v=7JDEK4wkN5I

Tofasio
  • 425
  • 3
  • 14
2

There are several ways. As you said, you cannot have two different apps with the same package name.

But you can for example have two different apps sharing the same UID using android:sharedUserId, meaning they can access each other's data. This means that the premium app could read the data directly from the basic app, or migrate it to itself in case the user want to uninstall the basic version. The premium app could disable parts of the basic app to avoid duplicate entries (such as the launcher activity etc). Depending on how this is done, you might end up in a situation where both apps need to remain installed though, and it could get confusing.

Another option is to have all functionality in the same application package, but have certain parts of it locked for basic users, and have the premium package simply contain some sort of key needed to unlock the premium parts. In practice this could mean that the premium package could have a launcher activity that on first launch performs the unlock (e.g. writes something into a database owned by the basic app) and then disables itself so it disappears from the launcher. Care must be taken to make this approach secure though, to avoid unauthorized unlocking.

JHH
  • 8,567
  • 8
  • 47
  • 91
2

Use one app and make different user access rights. The ones with premium access can get both premium and free functions. The normal accounts can get free functions. You can get inspiration from Spotify's app.

All the access rights can be defined in a server. When a user logs in, the access right is retrieved. Your app can check the access right and define the possible functions for the user.

flame3
  • 2,812
  • 1
  • 24
  • 32