1

I created a standard Android app (ex. MyApp) which works fine. Now I would like to create a pro version that extends the standard app (ex. MyAppPro extends MyApp). From other articles I learned, that it is not possible in Android to extend from another App but only from a lib. But MyApp should be runnable too. What is the best practice to reach the goal?

Thanks for your help Robi

Ramin
  • 390
  • 3
  • 6
  • I would check the response to [this][1] SO thread. [1]: http://stackoverflow.com/questions/3711967/best-way-to-have-paid-and-free-version-of-an-android-app – broschb Sep 03 '11 at 01:02

2 Answers2

2

Create a library of your original MyApp, then create a MyApp project that references LibMyApp try not to code anything that you don't want shared here. Setup your manifest with references to you Activities and such in LibMyApp. Create MyAppPro project reference LibMyApp, extend your library with MyAppPro only code.

Dan S
  • 9,139
  • 3
  • 37
  • 48
  • That works, thank you! First, I changed the MyApp project properties -> Android to 'Is Lib', then exported the Project as jar file. I had to exclude the manifest and the res folder in the export wizard because of duplicate errors when I added the jar file to the build path. But now it works. I created 2 apps that extend the lib. – Ramin Sep 03 '11 at 21:55
  • You don't need to export the lib (if you're using eclipse and adt), just use the Android project settings and add it as a library. – Dan S Sep 04 '11 at 18:08
  • Thank you again Dan S. I removed the jar from the build path and added the lib in properties -> Android. I had not even to exclude the manifest and res file. Excellent! – Ramin Sep 04 '11 at 22:49
0

Make use of the licensing options set up within the Android Market to change the look and behavior of your application.

See here for more information: http://developer.android.com/guide/publishing/licensing.html

Kurru
  • 14,180
  • 18
  • 64
  • 84
  • This isn't what he is looking for. The link you referenced is to actually license a version of an app and disable the app if the license is invalid, vs. enable/disable features based on two different apps(pro vs. standard) – broschb Sep 03 '11 at 00:43
  • Ah was going to use that myself to do the same thing, but guess not if its doesn't work :-/ – Kurru Sep 03 '11 at 00:50
  • On reading it, I'm still not sure that you can't use that functionality to display pro version of an app. Seems you're given the option of what to do if its "not licensed" – Kurru Sep 04 '11 at 22:56