Branded Android App

We serve several customers. One of the features that we want to offer is an Android application that allows the client to customize the application (icons, logos, names, etc.).

Here are a few points.

  • Customers customers will use this application.
  • You can be a client of more than one client, but we cannot show the user any list of clients.
  • Customers cannot use a single application.
  • The application should be able to look different for each client, although the functionality is the same

Yes, I know that it is PITA to build it this way, but our customers do not want other customers to know that they are also our customer.

So, what is the best way to create an easy-to-brand app with minimal workload on developer wisdom?

+4
source share
4 answers

I would start by developing a script for the global re-name, as you need it (can be done quite simply with find, xargs and sed)

You will need tools to configure resources, which can be plug-ins of the SDK and Eclipse.

Perhaps you could create a kind of wizard that extends the Eclipse plugin.

Or with more work, but simpler use, you can do something separate that manages the necessary command line tools to create the generated package.

+1
source

Keep a separate res / folder for each version of the application. Give each icon, logo, and String the same name, but configure the content for each client and create for each other .apk by simply dropping this res folder into the assembly. I don’t think that you can make special qualifiers for this and just make one .apk - and this in any case will connect all client user images and strings for each application.

+5
source

You can do what @Jems said, or (assuming the application is interacting with the server) put the "logic" on the server side.

When you first start the application, the server will send you resources that correspond to your client, which you store locally.

Problems with this approach: for the first time, you may have to load the load ...

Advantages: you just need to change the property bar, which indicates which server or server login to find out what it should send, changing the layout, without having to deploy another application with different resources.

It really depends on whether you want to support layout changes on the server side.

+1
source

A solution for building time using gradle can be achieved using the productFlavors function described at http://blog.robustastudio.com/mobile-development/android/building-multiple-editions-of-android-app-gradle/

Flavors (for example, customer brands) can be defined in the build.gradle file as follows (here are different package names to deploy each branded apk as a separate application):

productFlavors { vanilla { applicationId "com.example.multiflavorapp" } strawberry { applicationId "com.example.multiflavorapp.strawberry" } } 

Then, in the src / vanilla / res or src / strawberry / res directory, it was possible to place specific Android resources for the brand (instead of the src / main / res directory) (in this case, vanilla and strawberry are brands). Keep in mind that using productFlavors, gradle does not merge assets, but simply replaces files without any knowledge of specific res subdirectories.

During construction processes, gradle creates build options as a combination of build type (debug, release) and productFlavor, more at http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build -Type-Product-Flavor-Build-Variant .

+1
source

Source: https://habr.com/ru/post/1339872/


All Articles