ability to update ip address in Android application
<p>I am working on an Android application which talks to web application I run the Rest server locally
but if my server ip changes or port changes I have to build the application
is there any solution that make ip address update himself?
this is my code to receive my web service</p>

<pre><code>public class TableauDeBordFragment extends Fragment {

    public static final String SERVEL_URL = "http://192.168.2.120:8082/access-control-web/rest/roles/attendance";

    List&lt;Employe&gt; employes;
    ListView tableauDeBordListview;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

       employes = new ArrayList&lt;Employe&gt;();
        View view = inflater.inflate(R.layout.fragment_tableau_de_bord, container, false);
        tableauDeBordListview = (ListView) view.findViewById(R.id.tableaudebordlist);
        DownloadJSON downloadJSON = new DownloadJSON();
        downloadJSON.execute();
        return view;
    }

    public class DownloadJSON extends AsyncTask&lt;Void, Void, Void&gt; {

        @Override
        protected Void doInBackground(Void... params) {
            try {
                URL theURL = new URL(SERVEL_URL);
                BufferedReader reader = new BufferedReader(new InputStreamReader(theURL.openConnection().getInputStream(), "UTF-8"));

                String jsonStr =  reader.readLine();
                JSONArray jsonArray = new JSONArray(jsonStr);
                for (int i=0;i&lt;jsonArray.length();i++)
                {
                    JSONObject jsonAttendanceItem = jsonArray.getJSONObject(i);
                    JSONObject jsonEmployeeItem = jsonAttendanceItem.getJSONObject("employee");
                    Employe employe = new Employe();
                    employe.setFirstName(jsonEmployeeItem.getString("firstName"));
                    employe.setLastName(jsonEmployeeItem.getString("lastName"));
                    employe.setPhoneNumber(jsonEmployeeItem.getString("phoneNumber"));
                    employes.add(employe);
                }
                 } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        @Override
        protected void onPostExecute(Void aVoid) {
            super.onPostExecute(aVoid);


            ArrayAdapter&lt;Employe&gt; adapter = new TableDeBordCustum(getActivity(), employes);
            tableauDeBordListview.setAdapter(adapter);

        }
    }
}
</code></pre>