I have multiple android app running on same code base but the project resource and API are different. I have read the following question How to create multiple Android apps from one code base and my problem is that how to manage the project resource like images,color,text which was entirely different in each app.
Resources in app projects override ones with the same name in library projects. So you just add the images, etc. to your app project and it works out more or less automatically.
Related
Some time ago i created a wear module on existing project.
Both modules have identical Application ID and packages.
Is there any possibility to solve this problem without creating new Android Library to contain classes which i want to be shared? (I have too many files and it will take too much time to fix project)
Afraid not (there is no "possibility... without creating new Android Library"). The handheld and wearable apps are distinct APKs, running on separate devices, and cannot share code at runtime. You need to move your common code into a library that will be compiled into into both.
I've been asked to white label an application I am making which has resulted in me needed a project with the exact same code base, but a different manifest and different resources files. Is there currently a way to do that supported by android studio? Or is the only way to try to do it with multiple full projects and updating both?
I want to create several different apps/projects that all use a common code base, as well as the same activities and views. The unique things between each project would be:
App name
Bundle identifier
Icon
Version
Analytics ID
Web service URL
Various images and colors
I believe this would involve creating a library project that contains the common code between projects, and then creating each project with the unique items above that reference the library project. Is this the approach I should be taking? Am I able to create all the views/activities in the library project and have the other projects use these?
Thanks!
I'm working with Android Studio 0.5.8.
I have a Working project, and I want to reuse all its contents to make an almost identical app with only another name and different colors.
Basically I want to make a library from the original app and reuse it in various identical apps, but I don't want to copy & paste inside each new app, I want to maintain and develop only one codebase (the project library).
I have read and read, but I can'tt find any real solution.
I tried this in my settings.gradle:
include ':AppCopy1', ':..:LibraryProject'
It works, but I cant use any classes in AppCopy1.
This sounds like a good candidate for Product Flavors. The Gradle build system has support for maintaining a single codebase and building multiple apps from that codebase that only differ by a few files changes. See the configuration examples here: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants for details.
I have a small Android project that I use as a core project. From this core project I want to be able to do customisations.
So I have the app in a framework format using standard icons, buttons etc... I want to be able to create different versions with different icons and buttons.
This I know how to do. (I will have two separate apk files, both with the same code but with different resources)
However I want to be able to install the core project and a customisation on the same device at the same time. Currently one will overwrite the other.
I have tried to change the package in the manifest but this in turn means I would have to also change all the imports for R.java in my Java files, this is something I want to avoid.
Is it possible to change just something in xml that will allow me to have two projects using the same Java files but with different resources?
You should use Android Libraries.
Put all your application code into one Android Library and then create two Android Applications which have custom icons and different package names. The resources defined in final Android Applications will override all already existing resources in Android Library.
One drawback: you'll need to have to almost identical copies of AndroidManifest.xml files in your Android Application (but they still should have different package names).
For more info:
Android's documentation: Settings up Android Library project
My post: Android Application, Android Libraries and Jar Libraries. This one describes how Android Libraries work.
You should create a library project that contains all of your source code, and create a project for each of your installable packages that references the library project. You can then define/override any resource definitions in the installable projects