Stefano
Stefano

Reputation: 164

Is there a way to distribute an Android app with an external config file?

I have an Android application that needs to read some custom parameters at startup (e.g. an URL). Those parameters are different from customer to customer.

What I'm expected to do is:

I don't want to have a config file inside the app project: if I need to give the app to a new customer, I'll only need to write a new custom_par.xml for him, and pack it together with the standard "common" APK.

Is it possible?

Upvotes: 1

Views: 2005

Answers (1)

natario
natario

Reputation: 25194

I see two way of dealing with it:

  • Tell your customer to place the config file in a specific directory, and have your APK read and parse the xml at startup. It is not difficult but requires bothering the customer about storing the config file;

  • Create a second, lightweight application with just the parameters you would put into the config file. You could then distribute the second APK along with your main app, and have these two apps communicate.

Upvotes: 3

Related Questions