I have an Android app that is used by many enterprises, each one has their own Server Address and Port.
When each enterprise downloads my app I want them to be able to configure the Server Address and the Port number. Maybe the IT administrator of that company can change the values in a configuration file so that the user would not worry about the Server Address and port number and just has to to enter the UserId & Password.
I found one document in Android Developer website: https://developer.android.com/work/managed-configurations
I can understand the code from the above link but I am not sure how an IT administrator can push the configuration file to the app (in an EMM console or something). Any idea would be highly appreciated.
When you expose managed configurations for your app, organizations using your app can configure it from their device management console. The console is different depending on the device management solution they use.
For example, G Suite customers can configure apps from admin.google.com (see the help center, section "Create managed configurations").
If you don't have a G Suite subscription you can use the Android Management Experience, which is a free demo of Android management capabilities. Once you've signed up go to "Choose & manage apps", add your app, and click the setting ison next to it in order to configure managed configurations.
Note that the settings organizations see in the console are the ones exposed by the latest production version of your app in Google Play.