Last active
December 20, 2015 21:08
-
-
Save guilhermecarvalhocarneiro/6195255 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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