Skip to content

Commit

Permalink
Mejorando la config de url de backend
Browse files Browse the repository at this point in the history
  • Loading branch information
marianosimone committed May 28, 2012
1 parent 0bc3c6c commit 91e4f9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions android/Meteoro/src/ar/nahual/meteoro/MeteoroBackend.java
Expand Up @@ -18,13 +18,15 @@ public Uri getCitiesUri() {
}

public Uri getForecastUri(final String cityCode) {
return new Uri.Builder().scheme("http").authority(getServerUrl())
return new Uri.Builder().scheme("http"). authority(getServerUrl())
.path("get_forecast").appendQueryParameter("city", cityCode).build();
}

public void changeUrl(String url) {
SharedPreferences settings = this.context.getSharedPreferences(PREFS_NAME, 0);
settings.edit().putString("server-url", "url");
SharedPreferences.Editor editor = settings.edit();
editor.putString("server-url", url);
editor.commit();
}

private String getServerUrl() {
Expand Down
Expand Up @@ -68,7 +68,6 @@ public RequestForecastTask(final VerCiudadActivity activity) {
@Override
protected List<Pronostico> doInBackground(final CiudadPersistida... params) {
ciudadElegida = params[0];

final HttpGet request = new HttpGet(MeteoroApplication.getBackend().getForecastUri(ciudadElegida.getCityCode()).toString());
HttpResponse response;
try {
Expand Down

0 comments on commit 91e4f9b

Please sign in to comment.