Reputation: 63
I'm here to discuss about different ways to handle an Android application that can point its APIs to a server A (ie. httq://a.myproduct.com/api/...) for the client A, or an other server B (ie. httq.://b.myproduct.com/api/...) for another client B.
What i do actually is to generate different APK of the same app for each client. This solution is okay for one or two client, but will become quite heavy to deal with later..
I'm trying to find a better way to have one unique APK which can work with different server url. Another constraint is that on a same device, i can have an app that talk to server A and an other app that talk to server B.
Here are the solution I came up with :
Have a file store somewhere that make the link between an app and a server for example:
com.mycompany.productA:httq://a.mycloud.com
com.mycompany.productB:httq://b.mycloud.com
But how to handle this file ? What is creating it ?
Does anyone, already experienced this ?
Upvotes: 0
Views: 735
Reputation: 8635
Considering you are able to map connecting devices IMEI to clients, I will briefly give you pros and cons of the three methods you mentioned.
Multiple APK's
Central Server
All URLs embedded into APK
Are you a large company? If yes, then you are probably having production servers already and could go with second method.
Upvotes: 1
Reputation:
I guess you can build a generic app and use some sort of auth system on the client app. For example, if the user identifies himself as "Client A", your web-service can "tell" your app to use the first endpoint. If it's "Client B", then it will be second endpoint. Bottom line is: make your users sign-in and then use credentials to distinguish the users.
Upvotes: 0