Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Override
protected String doInBackground(City... params) {
// TODO Auto-generated method stub
String nameCity, idCity;
nameCity = "Palmas";
idCity = null;
try {
JSONParser jsonParser = new JSONParser();
String url = "http://mobile.nuvolscloud.com.br/cidade/api/cidade/1/?format=json";
JSONObject json = jsonParser.getJSONFromUrl(url);
JSONObject jsonCityObject = json.getJSONObject("ativo");
// nameCity = jsonCityObject.getString("nome");
// Log.d("Turismo", jsonCityObject.toString());
} catch (Exception e) {
// TODO: handle exception
Log.e("ErroTurismo", e.toString());
return "";
}
return nameCity;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.