title: How do I update the BASE_URL defined in my gradle through UI?
body: <p>I am currently working on creating an alertdialog box with edittext in it which opens on tap on my login screen , which should allow the capability to update the BASE_URL defined in my gradle.
  Say for instance I am currently defining my base_url as follows:</p>
  
  <pre><code> buildConfigField("String", "BASE_URL", "\"https://myapp.com/api\"")
  </code></pre>
  
  <p>which upon running the app translated to a buildConfig URL such that in Buildconfig.java it shows as :</p>
  
  <pre><code>  public static final String BASE_URL = "https://myapp.com/api";
  </code></pre>
  
  <p>Now my question is ,how do I update this base url on the edit text box i add in the alertdialog on the login screen, such that if i change the edit text text to :</p>
  
  <pre><code>https://myapp.com/api2
  </code></pre>
  
  <p>upon clicking save it should save the new entry and apply it to buildconfig file throughout the course of the app. I also want to display a reset button to allow the capability to reset this URL back to the original. Any ideas how to go about it?</p>
  
  <p>am using a similar code for alertdialog as this : <a href="https://medium.com/@mujtahidah/custom-dialog-with-edittext-and-button-action-android-fc64ef5eb2b2" rel="nofollow noreferrer">https://medium.com/@mujtahidah/custom-dialog-with-edittext-and-button-action-android-fc64ef5eb2b2</a></p>
  
  <p>Just want to know if there is a way BASE_URL can be updated in the UI dynamically and saved on the fly? Any ideas or examples?
  Thanks in advance!</p>