gpt4 book ai didi

java - NetworkSecurityConfig : No Network Security Config specified -- Android 7. 0 错误?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:01:59 24 4
gpt4 key购买 nike

我有一些关于 android 7.0.0 的问题。

我在我的应用程序中使用了 volley 库,它在 Android 7.0 之外运行良好

这是我的部分代码;

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);
}

如果我在 Android 7.0 上测试我的应用程序,控制台的输出是;

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.

但这只发生在 Android 7.0 上,应用程序看起来是空白的,因为它没有从互联网上得到响应

.我该如何解决这个问题?

最佳答案

这条消息没有问题:

D/NetworkSecurityConfig: No Network Security Config specified, using platform default 

D/ 表示这是一条调试消息。它表示您没有定义自己的网络安全配置,因此平台默认规则适用。这很好。

application looks empty because it does not response from the internet

据我所知,您正在解析一些 JSON,对其进行迭代,然后填充 kisiler。也许 kisiler 没有连接到您的 UI。

关于java - NetworkSecurityConfig : No Network Security Config specified -- Android 7. 0 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41365334/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com