user1041858
user1041858

Reputation: 957

create free (with ads) and paid (without ads) app in same project

How to create a free (with admob advertisements) and paid (without advertisements) app in same project in android?

I have found a solution by creating the library project but in my case I have to remove only adviews from paid app. So is this the best way to create library project in my scenario? Or there is any other good way?

Upvotes: 0

Views: 313

Answers (2)

weston
weston

Reputation: 54811

I have successfully done this before, and it can be used in conjunction with libraries to even better effect (less merging).

Assuming you use a SCM, I use SVN.

  1. I design the advertised one first, and committed it.
  2. Then I branched it along side the original, i.e. not with the branches, just along side but within trunk so I can add it to Eclipse as well.
  3. I renamed the project (in the .project file) before importing existing project into Eclipse.
  4. Renamed the applications package (From Eclipse->Android Tools->Rename Application Package)
  5. Removed adverts and committed.
  6. Future changes are made in the advert one first, then I merge in to my non-advert branch.

Just to make it clear, this is the SVN organisation:

trunk
  -Adverts
  -No Adverts (branch of Adverts)
  -Library (Can be shared by both)

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007584

So is this the best way to create library project in my scenario?

Today, yes, because "remove only adviews" probably involves a fair amount of work:

  • Different layout resources to take into account ads versus no-ads
  • Removing the ad network's JAR or other client-side code supplied by the ad network
  • Removing any other ad network initialization from your code, if any

Eventually, when the new Gradle-based build system is fully documented and ready for use, I think that there will be simpler solutions for this.

Upvotes: 1

Related Questions