0

I have some project named MyApplication and demo version called DemoOfMyApplication. I have a lot of classes that must be in both projects, so I want MyApplication and DemoOfMyApplicationbe in the same project. For first one I can call Main1 class and for second one Main2. So I'll have two applications in one.

The main thing I want is to have different icons in my device's menu for MyProject and DemoOfMyProject.I understand that these two versions must have different Application packages. SO Can I change them from code? Or is there any way for doing what I want?

Thanks

4
  • You can't change app properties in code since code does not run when you e.g. upload it to google's play store. Values have to be hardcoded inside the apk. Commented Oct 15, 2013 at 12:29
  • Thanks for response. I have read this article android-developers.blogspot.com/2011/06/… but I really hop that There will be some way to change application package from java code. Commented Oct 15, 2013 at 12:33
  • 1
    Changing package name at runtime probably never because that name has to be known before you install the app. Not installed = no code running that can change it. Commented Oct 15, 2013 at 12:50
  • Thanks, good notation Commented Oct 15, 2013 at 13:02

1 Answer 1

1

Refactor the commonly needed code into a library project and reference that from both MyApplication and DemoOfMyApplication?

Then you can have two separate applications, with different package names. It doesn't sound like a great idea to try and cram both applications into one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.