Android Studio: Core App With Different Wrapper For Every Customer
Solution 1:
I have built both types of apps - apps that share and require a core library, but have different UI implementations and apps that have all the core functionality built-in, and then separate apps that modify the "look and feel" of the core app. In both cases, all activities are in the "core" app and none are in the "wrapper" or helper apps.
The biggest issue here is the "dependency" on the core app. Do you want to maintain and market the "core app" as a flagship product, while the other "apps" are really just "themes" for the core app? Or are you wanting to maintain and market a suite of apps, without really having a core or flagship app?
If you create the core "app" as a library, you have to remember that there are a few restrictions on library projects. For example, you cannot use a "CASE" statement if it uses "R.java" resources because the R.java
file is built at compile time, and case
statements cannot be constructed on subsequent 'R.javadependencies. (You can convert to
if-else` pretty easily though, in most cases.) You may find that the conversion has restrictions that you cannot avoid and that cause flaws, but usually re-designing the implementation will circumvent any such problems. In other words, you make have to work hard to get it done, but you should be able to do it.
EDIT:
If you create a project library, then any changes you make to the library will be reflected in the "wrapper" apps the next time you build them. This is great because it makes it easy to update "all apps" - but it's terrible for regression testing. In other words, after any update to the library, you may need to test every app (which is boring) because there may be exceptions in any one of them. However, a strict adherence to design and coding can help reduce or eliminate this. I've just found that actually testing each app is about the only way to avoid problems unless the "wrapper" apps are very simple and well defined, which is very rare.
Solution 2:
I would suggest making most of your application into a library project. Then the original application and the new one would be new projects that depend on the library and would define their own app-specific resources.
Post a Comment for "Android Studio: Core App With Different Wrapper For Every Customer"