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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:07:46+00:00 2026-05-22T16:07:46+00:00

I have a game I have built that will have 2 versions. One lite

  • 0

I have a game I have built that will have 2 versions. One “lite” and one “full”.
For this purpose I put the large part of the code in a library-project.

Thing is that within part of the code I have to start an Activity whose code will be in the program project and not the library one.
I found that it will not compile.

What I did to solve it was to create a dummy class for the activity within the library-project but it is probably not the right way to go.

  • 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-22T16:07:47+00:00Added an answer on May 22, 2026 at 4:07 pm

    If youre saying that some part of the library project is dependent on a class that will have one implementation in one app project and another or possibly non-existant implementation in another app project, then I suspect a simple interface would help.

    Declare an interface in the library project and change all references in that project to your interface. In the app projects, provide different classes that implement that interface and vary their behavior according to whether it is lite or full.

    I cant see how a dependency on an Activity would manifest itself since in most every case you reference an activity it’s by the ComponentName via string.

    As as small example, pretend we want to be able to inject an ad banner image view into a view group in our lite edition, but do nothing, or maybe hide the view group in our full edition.

    In the library project declare an interface for AdBannerProvider:

    public interface AdBannerProvider
    {
        public void InjectAd(ViewGroup v);
    }
    

    In Activities in the library project that maybe need an ad depending on lit or full, reference the interface as in:

    private void getAdBanner(AdBannerProvider pProvider, ViewGroup pAdView)
    {
         pProvider.InjectAd(pAdView);
    }
    

    Then in the Lite edition, provide an implementation of AdBannerProvider that does the right things for that edition:

    public class LiteAdBannerProviderImpl implements AdBannerProvider {
       @Override
       public void InjectAd(ViewGroup v) {
              // do something useful for the lite edition, like add an imageview to the passed viewgroup
       }
    }
    

    And in the full edition, another class the does the right thing for that edition:

    public class FullAdBannerProviderImpl implements AdBannerProvider {
    
        @Override
        public void InjectAd(ViewGroup v) {
            // do something useful for the full edition, like maybe set the viewgroup to GONE or INVISIBLE
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Silverlight 2 project (game) that will require a lot of character
For a learn-as-I-code game that I'm designing, I have a pretty rudimentary map: http://www.dixieandtheninjas.net/dynasties/images/dynasties_map_2.jpg
I am trying to code a global lookup table of sorts. I have game
If have I have a game engine that has multiple threads that all work
I have a game that currently runs under Windows and Mac OS X and
I have this game where balloons are coming from bottom and player has to
I have a game engine that uses OpenGL for display. I coded a small
I have this game with some variety of textures. Whenever I draw a texture
I have built an activity to handle gestures in my Android game and want
I'd like to build a turn-based, multiplayer iPhone game that will require a game

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.