私はJSONをretieves Webサービスにアプリケーションを接続しようとしているにJSONを充電するが、JSONExceptionを返すためにの問題は私のAndroidのアプリケーション、JSONException
マイコード:
private class LlenarDatosReproduccion extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
try {
return downloadUrl(urls[0]);
} catch (IOException e) {
return "Ups! Error.Parece que la url es inválida";
}
}
@Override
protected void onPostExecute(String result) {
try {
JSONObject responseJSON = new JSONObject(result.toString());
JSONArray cancionJSON = responseJSON.getJSONArray("cancion");
tvTitle.setText(cancionJSON.getString(1));
//tvArtist.setText(cancionJSON.getString(2));
} catch (JSONException e) {
e.printStackTrace();
}
super.onPostExecute(result);
}
}
Logcatの画像を見てください。
あなたはjsonレスポンスを投稿しますか? –
oyuはdownloadUrlで何をしているのですか? –
ここにhttps://pruebasmartunes.000webhostapp.com/pruebas_getMp3StreamTitle.php –