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

  • Home
  • SEARCH
  • 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 7690859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:29:33+00:00 2026-05-31T20:29:33+00:00

I’ve searched around SO for this and found a few things, but I’m still

  • 0

I’ve searched around SO for this and found a few things, but I’m still not sure I fully understand, so I ask you for clarifications.

Here is what I need:

  • Have a project that has specific function: interrogate web service, display results in different views

  • Have a second, third and forth project that has exactly the same functionality as the first one, but only different graphic elements like splash screen image, icon, name, package name.

So, I have ProjectCore with activities and functionality. Project1 with a car icon and car image for splashscreen. Project2 with airplane icon and airplane image for splashscreen. Something like that. Each projects has a class with constants like’appId, appName, appServerURL”… All the web service call, data display is in Core as it’s the same for all prohects, only the read is made from Constants class.

I was thinking of this approach

  1. Make ProjectCore a Library project with a package like com.domain.core and dummy images
  2. Make Project1, add reference to ProjectCore in it and with a package like com.domain.code.project1 and in resources folder, put images with same name as in core project
  3. Make Project2 on the same principle like project1

Will this approach work ?

Thanks.

Later Edit. I’ve tried as mentioned before. For instance in Core project I had in drawable a file called splash.png. In Project1’s and Project2’s drawable folder I’ve put spash.png file with other images. This works fine. Running the Project1 and Project2 on my phone, started each app with it’s own image. So far so good.

Then, because I have different constants I need to use in my App, I went into Core library project and added:

public class C {
    public static String SomeConstant = "Project core!";
}

Here comes the problem, I need to have different constant values across Project1 and Project2. Because on Core project, the class is in com.domain.core.utils for instance… I can’t add the same package in Project1 and Project2. How do I add the classes so I can update their values and be used on each project with particlar values ?

public class C {
    public static String SomeConstant = "Project 1 constant!";
}

public class C {
    public static String SomeConstant = "Project 2 constant!";
}

Thank you!

  • 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-31T20:29:35+00:00Added an answer on May 31, 2026 at 8:29 pm

    You want to create your functionality in a Library project and then have all of your Branded/OEM/3rdParty projects extend from this, overriding images and string resources where necessary.

    When you need to use “Constants” you should instead have a single “run once” portion of your code (such as a splash screen) load these strings from resource files:

    public static final String CONSTANT_ONE;
    
        public void onCreate() { CONSTANT_ONE = getResources().getString(R.String.CONSTANT_ONE); }
    

    EDIT

    I’m unsure on how initialising a final value on onCreate() will perform. If final doesn’t work well and you’re worried about changing the variable during program execution then make the variable private (so only that class can assign to it) and then create a public static String getConstantOne() function.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.