Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8148951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:45:02+00:00 2026-06-06T14:45:02+00:00

I understand that the best way to develop a free and paid version of

  • 0

I understand that the best way to develop a free and paid version of you app is to have a library project which contains the main bulk of the program. The free and paid projects will then use this library project. This allows the free and paid projects to have different resources.

However, my question is how do we limit functionality within the free app (or extend it for the paid app)? For instance, my free app will only be able to access the latest row in a database table whereas the paid app can access all the rows.

One way to do this would be to have a boolean flag in resources somewhere that you set to true for paid and false for free. At runtime the library project checks for the boolean flag and alters behavior accordingly. However, this seems very easily to hack for any potential attacks. Are there better ways?

Would this be easier to complete with one free app and then use in-app billing to unlock the pro functions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:45:03+00:00Added an answer on June 6, 2026 at 2:45 pm

    IMHO, Java/Android does not make it easy in this scenario. Ideally you should have one codebase, and able to compile a paid or free version at will. The free version will have critical methods/classes disabled, so that no one can tinker with database or xml to enable full functionality of the app.

    One way to do this is with conditional compilation, which again, Java does not support. However, there are some Ant tasks that can do this, e.g. http://prebop.sourceforge.net/doc.html. You can add something in the code like this:

    /* $if paid_version$ */
    public void paid_method() {
    
    }
    /* $endif$ */
    

    The above code will get removed, if the ant target you are building does not have the variable paid_version defined.

    How to setup prebop is another topic altogther, it’s complicated but worth it to have a single codebase.

    Update May 2013: The new Android build system based on Gradle makes building paid and free APK slightly easier. See Android Tools website for topic on ‘Build Variants’. In short, you can structure your source like this:

    /src/main/
    /src/paid/
    /src/free/
    

    All the shared code reside in /src/main, paid code in /src/paid and free code in /src/free. The build system will create paid and free APKs for you. However, one feature that is still missing is the ability to do conditional compiling in the source itself. As of this writing, the Gradle build tool is still in beta state, so hopefully this will get added in the final release.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that the best way to deploy a rails site is with passenger.
I understand that the best way to call a method in a superclass in
I understand that JavaScript isn't really made to open and save files. The best
When sending HTML e-mail, I understand that it's a best practice to send a
I understand that double locking in Java is broken, so what are the best
I have a fork of a project which I am contributing to. Currently, I
What is the best way to limit the amount of text that a user
What is the best way(performance) to have a bi-directional data flow between user-level and
I have been in this forum before to find the best way of creating
I can develop an application/project. But that is not in the correct coding standard.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.