-2

How can a double version of an app be realized, for instance a Free and a Premium one?

Is possible to have some controls, like EditTexts, Buttonms, etc, be shown only in a Premium version?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Andrea Bandiera
  • 109
  • 1
  • 3
  • 14

2 Answers2

2

Of course it is. You can do findViewById(R.id.premium).setVisible(View.GONE) in your free app to hide controls that should only be visible in the premium version.

You might also be interested in In App Billing Documentation.

sulai
  • 5,204
  • 2
  • 29
  • 44
0

I think the best way is separating both versions into two library projects; so in one you would add just the free version and in the other one the full version.

Each of them should have their own structural files, such as drawable resources, Manifest... You'll be able to find more info in several other StackOverflow questions such as this (just googleing a little you'll find a bunch).

Community
  • 1
  • 1
nKn
  • 13,691
  • 9
  • 45
  • 62
  • But doing so you'd have to maintain two separate versions, possibly introducing errors in one of the two or forgetting to update something in one... Of course it's an option, but it's a pain in the ass! – Phantômaxx Jan 24 '14 at 16:21
  • Yes, of course they are two separate versions, but your two implemented version also are! Imagine that one functionality depends on the other's existence, you'll have to enable/disable both in one of your versions, and keep track of a lot of details, but that's the price of making some money. – nKn Jan 24 '14 at 16:25
  • I'd go for the visible/invisible solution. It's a lot easier to maintain - in my vision. Just enable some things at runtime (disabled by default) and you're done. These will be enabled by a licence file (in which there's some function to return some special code you can check in your app when the file is present - or the file contains some binary bit, maybe hidden inside an image or a sound file or something completely random except that bits at certain calculated positions) ;) – Phantômaxx Jan 24 '14 at 16:34
  • 1
    @NKN 's solution is also valid. It depends on how different the premium version is from the free version. If there is a lot of difference, a library project, or branching (and merging common changes) are better options. Another aspect is security: If you want to prevent users to hack into your premium features by changing the apk, it might be a better option to provide an extra apk that does not have those features compiled in. – sulai Jan 24 '14 at 16:44