I have some problem for android 7.0.0.
I use volley library for my application, and it works well except for Android 7.0
Here is part of my code;
String url_goster = "http://185.126.217.71/clog.php";
RequestQueue requestQueue;
StringRequest request= new StringRequest(Request.Method.POST, url_goster, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
JSONObject veri_json;
try {
veri_json = new JSONObject(response);
JSONArray serial_no = veri_json.getJSONArray("Bilgiler");
for (int i = 0; i< serial_no.length(); i++){
JSONObject bilgis = serial_no.getJSONObject(i);
// JSON olarak verileri ?ekiyoruz
String GELEN_SERIAL = bilgis.getString("GELEN_SERIAL");
String TERMINAL_ADI = bilgis.getString("TERMINAL_ADI");
String SICAKLIK_T1 = bilgis.getString("SICAKLIK_T1");
String SICAKLIK_T2 = bilgis.getString("SICAKLIK_T2");
String SICAKLIK_T3 = bilgis.getString("SICAKLIK_T3");
String SON_DATA = bilgis.getString("SON_DATA");
String NEM_H1 = bilgis.getString("NEM_H1");
String NEM_H2 = bilgis.getString("NEM_H2");
String NEM_H3 = bilgis.getString("NEM_H3");
String SENSOR_1_AD = bilgis.getString("SENSOR_1_AD");
String SENSOR_2_AD = bilgis.getString("SENSOR_2_AD");
String SENSOR_3_AD = bilgis.getString("SENSOR_3_AD");
int SENSOR_SAYISI = bilgis.getInt("SENSOR_SAYISI");
kisiler.add(new Kisi(TERMINAL_ADI, SON_DATA, SENSOR_1_AD, SENSOR_2_AD, SENSOR_3_AD, SICAKLIK_T1, SICAKLIK_T2, SICAKLIK_T3, NEM_H1, NEM_H2, NEM_H3, GELEN_SERIAL, SENSOR_SAYISI));
}
} catch (JSONException e) {
Log.e("JSON ALIRKEN HATA",e.getLocalizedMessage());
Toast.makeText(getApplicationContext(), "Server'a ba?lan?l?rken bir hata ile kar??la??ld?.", Toast.LENGTH_SHORT).show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> params = new HashMap<String,String>();
params.put("ad",USER);
return params;
}
};
requestQueue.add(request);
}
If I test my application on Android 7.0, the output of console is;
D/NetworkSecurityConfig: No Network Security Config specified, using
platform default I/Choreographer: Skipped 127 frames! The application
may be doing too much work on its main thread.
but this only happens Android 7.0 and application looks blank because it doesn't get a response from the internet
. How can i solve this problem ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…