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 7606225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:21:23+00:00 2026-05-31T00:21:23+00:00

Just started playing with Android and I’m trying to create an app that has

  • 0

Just started playing with Android and I’m trying to create an app that has free and paid version. I’m new to Java as well but I’ve managed to create a simple working application in Eclipse which consists of 2 main projects (one for the free version, and one for the paid version).

I also have a library project which contains shared code (activities, resources, strings etc) and is referenced by the main projects. What I want to do (and this may well be the wrong approach) is enable or disable things in the the library code depending on whether I’m running the free or paid version.

So for example I have a Main activity in the library project and I want to do something like:

if (version == "free") //version would somehow be set by the main project
{
   //disable a paid feature
}

Obviously I need to somehow work out in the library whether I’m running the free or paid main project so I can enable/disable features when I need to. What’s the best approach to do this? For example could I use some kind of global setting in the main project, and somehow read this in the library project – I don’t want the library project to know about the main project, if that makes sense?

I’m a quick study so feel free to point me in the direction of any articles, etc.

  • 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-05-31T00:21:24+00:00Added an answer on May 31, 2026 at 12:21 am

    Your code works, but I’m not sure storing your paid/free flag in your manifest is the best solution if you are using the same apk to have both free and paid (unlock) functionality. Instead I would do this by adding a method in the library project which allows any project to set a flag on whether the app is free or paid.

    ex in library project:

        void setAppPurchasedMode(boolean purchased)
        {
            appPurchased = mode;
        }
    

    and in your library, you can check vs this flag:

        if (appPurchased)
            // show unlocked content
    

    So in your main project, if the app has been paid for:

        Library.setAppPurchasedMode(true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started playing around with threading today and I ran into something that
I just started playing around with the 960 CSS framework and found that it
Good evening, I just started playing with Microsoft.Contracts (latest version) and plugging it on
I've just started playing around with android, so pardon me if this is a
I just started playing in scala. I got a method that accepts string array
After deciding to get some exposure to android app, i started playing with it
I just started playing with Berkeley DB a few days ago so I'm trying
I've just started playing with Google App Engine using php via Quercus. I'm not
I´ve just started playing around with Java and Hibernate and have gotten an application
I've just started playing with Eclipse RCP. A few things that I would like

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.