1

I developed an application with Xamarin, for both iOS and Android. I want to give this application to 2 companies, each one of them has different needs, so they need to have different features and a different logo and name.

For example, given CompanyA and CompanyB, CompanyA wants to call the app:"Application A" meanwhile CompanyB wants to call it "Application B" and obviously each ones with different icons. Also CompanyA wants the mapFeature, while CompanyB want to have a list of number(example of random thing) and CompanyA doesn't.

I want to compile this application like if it was modular, I thought to create a BaseAppSettings class, like this:

public class BaseAppSettings{
        private String _appTitle;
        private String _appIcon; //path to icon maybe?
        private boolean _mapFeature; // if true I'll do something like #if (_mapFeature == true ) addMap;
        other parameters;
}

From which I'll derivate different class for each Company that will use the app setting for each ones the feature and the parameter that they want.

Is this a correct way or a best-practice to do this? I wasn't able to find anything even if I find this very relevant to maximize the reusability of my code.

Hoping to be clear enough, thank you for your time

Davide Quaglio
  • 751
  • 2
  • 11
  • 31
  • Mmmm..Like this yeah, but imagine that tomorrow maybe also CompanyA wants the list.... So that way it's easier to have something that will let me to Enable it... Also I didn't write that besides from some feature, the app is 80% the same – Davide Quaglio Feb 09 '15 at 16:14

2 Answers2

0

I urge to follow your approach, it's the correct way.

You need to keep your CORE same for any company. What you should offer are components/features/add-ons which customers could request or buy.

Customizing using some class like base settings is okay, but remember to verify them with database side/server side. This will enable your security perspective.

Kavindu Dodanduwa
  • 12,193
  • 3
  • 33
  • 46
  • Yeah it's exactly why I need to have the same app for different companies...So, when I'm adding a feature to the app, should I use `#if ` and check if the feature is enabled or not? – Davide Quaglio Feb 09 '15 at 16:35
  • Checking for enabled features can be done wither from server side or application side. Choice is yours depending on your expectation. – Kavindu Dodanduwa Feb 10 '15 at 02:15
  • Is it not possible to just compile different app? Directly input the features at build time? So that the feature that is not implemented does not exist in the .apk(Android example) ? – Davide Quaglio Feb 10 '15 at 08:16
0

use the setting activity in your app from there u can enable or disable the feature. about icon see How to change an application icon programmatically in Android?

Community
  • 1
  • 1